Jobs: Android Developer @ HUDL, New York


We're hiring in: Nebraska, Texas, California, New York and the United Kingdom.
Would you like to work on a Top 50 Sports App in Google Play with a 4.4+ rating? Want to help define how mobile applications impact the future of athletics? Yes? Then for you, this is the best Android development job on the planet.
At Hudl, we build software that helps coaches and athletes use video and data to improve every day. We’re looking for an experienced Android-focused mobile developer to join one of our small, cross-functional teams.

You

  • Are experienced developing for Android. You use the devices daily, you’ve written and shipped at least one Android app, you understand the development environment and ecosystem, and you’re passionate about the platform.
  •  Translate complex, real-world problems into simple and elegant software solutions.
  •  Understand the balancing act between crafting a robust, lasting solution and banging something out right now.
  • Care about UI and Interaction. You're excited by the new Google Material Design. You’re willing to push the limits, not relying solely on default controls. You answer “Can this be done?” with: “We’ll figure out a way.”
  • Have a passion for code and product. You care about the craft of writing software and fight for the details that separate an average product from a great one.
  • Are excited to have your work used by passionate customers who rely on it to do their job during the key moments in games.
  • Hate the idea of being a cog in the machine—you are self-motivated. You want to own your work and have a say in the direction of the product.

We

  • Believe culture matters more than anything else.
  • Are young nerds, designers, marketers, and former jocks who love sports and tech.
  • Have a profitable, kick-ass product that is changing coaches’ and athletes’ lives.
  • Need you to help us build awesome software for coaches and athletes.
  • Are as passionate about winning as the coaches we serve.
  • Promise you’ll love coming to work every day.

Working with Us, You Can:

  • Enjoy an unlimited vacation policy.
  • Sleep soundly with our paid health insurance and retirement plans.
  • Get hooked up with free tickets to NFL & Div. I sporting events.
  • Work remotely from NY, TX, CA, MA or at our HQ in Lincoln, NE (relocation assistance offered).
  • Stuff yourself at free daily company-sponsored lunches.
  • Snack on free food and soda.

Load an ImageView by URL in Android


Image referenced by URL in an ImageView, getting image from url and set on imageview, then here is the some idea, which may helpful .

Here is the some snap codes:

// show The Image on button load click event
new DownloadImageTask((ImageView) findViewById(R.id.imageView1))
            .execute("http://java.sogeti.nl/JavaBlog/wp-content/uploads/2009/04/android_icon_256.png");
}

public void onClick(View v) {
    startActivity(new Intent(this, IndexActivity.class));
    finish();

}

private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
    ImageView bmImage;

    public DownloadImageTask(ImageView bmImage) {
        this.bmImage = bmImage;
    }

    protected Bitmap doInBackground(String... urls) {
        String urldisplay = urls[0];
        Bitmap mIcon11 = null;
        try {
            InputStream in = new java.net.URL(urldisplay).openStream();
            mIcon11 = BitmapFactory.decodeStream(in);
        } catch (Exception e) {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }
        return mIcon11;
    }

    protected void onPostExecute(Bitmap result) {
        bmImage.setImageBitmap(result);
    }
}
write permission on  AndroidManifest.xml to access the internet.

<uses-permission android:name="android.permission.INTERNET" />

 and convert whole ImageView to Bitmap from this code:

imageView.buildDrawingCache();
Bitmap bmap = imageView.getDrawingCache();

other examples:

http://www.learn2crack.com/2014/06/android-load-image-from-internet.html

http://www.androidhive.info/2012/07/android-loading-image-from-url-http/

http://theopentutorials.com/tutorials/android/imageview/android-how-to-load-image-from-url-in-imageview/

http://belencruz.com/2012/11/load-imageview-from-url-in-android/

Happy Coding!!!

video tutorials in Android

Are you searching video tutorials in android with and without free in android, here is the some links for that.



 why not you search on internet then ask. Go to first
I recommend you best android video tutorials provided websites are:
Official android videos
Lynda.com
mybringback.com
marakana.com
Thenewboston.com
xtensivearts.com

tutorials-android.com

Happy coding !!!

How to add a footer in ListView in android


Create a footer view layout consisting of text that you want to set as footer and then try

View footerView = ((LayoutInflater) ActivityContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.footer_layout, null, false);
ListView.addFooterView(footerView);

or may be use this also:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="7dip"
android:paddingBottom="7dip"
android:orientation="horizontal"
android:gravity="center">

<LinearLayout
android:id="@+id/footer_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_gravity="center">

<TextView
android:text="@string/footer_text_1"
android:id="@+id/footer_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:textStyle="bold"
android:layout_marginRight="5dip" />
</LinearLayout>
</LinearLayout>

and on activity
public class MyListActivty extends ListActivity {
private Context context = null;
private ListView list = null;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
list
= (ListView)findViewById(android.R.id.list);

//code to set adapter to populate list
View footerView = ((LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.footer_layout, null, false);
list
.addFooterView(footerView);
}
}


Happy Coding!!!


How to access child views from a ListView in android

Are you get lots problems during access child view from a listview in android, then here is the some solution that may helpful for you.



Android ListView: get data index of visible itemand combine with part of Feet's answer above, can give you something like:

int wantedPosition = 10; // Whatever position you're looking for
int firstPosition = listView.getFirstVisiblePosition() - listView.getHeaderViewsCount(); // This is the same as child #0
int wantedChild = wantedPosition - firstPosition;
// Say, first visible position is 8, you want position 10, wantedChild will now be 2
// So that means your view is child #2 in the ViewGroup:
if (wantedChild < 0 || wantedChild >= listView.getChildCount()) {
Log.w(TAG, "Unable to get view for desired position, because it's not being displayed on screen.");
return;
}
// Could also check if wantedPosition is between listView.getFirstVisiblePosition() and listView.getLastVisiblePosition() instead.
View wantedView = listView.getChildAt(wantedChild);

this solution copy from stackoverflow and i solved my solution from this:

Happy Coding!!!

Close or hide the Android Soft Keyboard from code


Are you trying to  make close or hide the Soft Keyboard in your app using code. here is the solution .

Force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field.

EditText myEditText = (EditText) findViewById(R.id.myEditText);  
InputMethodManager imm = (InputMethodManager)getSystemService(
Context.INPUT_METHOD_SERVICE);
imm
.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);


This will force the keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.HIDE_IMPLICIT_ONLY as the second parameter to ensure you only hide the keyboard when the user didn't explicitly force it to appear (by holding down menu).

Happy Codting

Validate email in JavaScript?


This is one of those useful things that people will be Googling for validate email address on Javascript, this tutorial mostly used when you are developing app on Cross platform, like sencha, phonegap.

function validateEmail(email) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(email);

}

Here, Using regular expressions is probably the best way. Here's an example (live demo):


Happy Coding!!!

Java Tutorials: Calculate fibonacci series in Java


Calculating fibonacci series in Java

public class Example1 {

public static void main(String [] args) {
 fibonacciLoop(5);
}

 public static void fibonacciLoop(int n){
      if (n == 0) {
           System.out.println("0");
       } else if (n == 1) {
           System.out.println("0, 1, ");
       } else {
           System.out.print("0, 1,  ");
           int a = 0;
           int b = 1;
           for (int i = 1; i < n; i++) {
               int nextNumber = a + b;
               System.out.print(nextNumber + ", ");
               a = b;
               b = nextNumber;
           }
       }
    }

Output:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,


ebook: Migrating to Android for iOS Developers


Migrating to Android for iOS Developers gives you - as an experienced iOS app developer - the ability to learn native Android apps development from scratch. Through case studies and examples, this book starts with a simple but meaningful Hello Android project. Then, this book continues by providing guidelines and tutorial projects showing you how to translate iOS apps to Android right from the beginning.

What you’ll learn

• How to maximize your existing iOS mobile knowledge to learn Android programming skills
• How to use the Android integrated development environment with the Eclipse ADT plugin
• How to translate your existing iOS code to Android with the following common mobile topics:
° Common mobile screen navigation patterns
° User interface components and UI animations
° Storing data
° Networking and using remote services
° Using system apps
° Maps and location awareness
° Mobile search frameworks
° Mobile analytics


  • SBN13: 978-1-484200-11-7
  • 532 Pages
  • User Level: Beginner to Intermediate
  • Publication Date: July 20, 2014 

  • What are the differences between git pull and git fetch?

    When you are getting confuse in git pull and git fetch, here is the some solutions, may be helpful.

    In the simplest terms, git pull does a git fetch followed by a git merge.
    You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/. This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I have even heard of people running git fetch periodically in a cron job in the background (although I wouldn't recommend doing this).


    A git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.

    or

    • When you use pull, Git tries to automatically do your work for you. It is context sensitive, so Git will merge any pulled commits into the branch you are currently working in. pull automatically merges the commits without letting you review them first. If you don’t closely manage your branches you may run into frequent conflicts.
    • When you fetch, Git gathers any commits from the target branch that do not exist in your current branch and stores them in your local repository. However, it does not merge them with your current branch. This is particularly useful if you need to keep your repository up to date, but are working on something that might break if you update your files. To integrate the commits into your master branch, you use merge.

    How to make app using phonegap in eclipse

    If you succesfully installed android SDK bundles, then create simple android project then follows the instruction:

    Add the PhoneGap library

    You now have a simple Android application. Before you can write a PhoneGap application, you need to add the PhoneGap library. There are two files: a JavaScript file that contains the PhoneGap API called by our application, and a native JAR file containing the native implementation for the PhoneGap API.
    1. Expand the AndroidPhoneGap project tree view, as shown in Figure 10:
      Figure 10. Android project with PhoneGap library
      Android project with PhoneGap library
    2. Create the directory \assets\www. Also create the directory \libs if it doesn't already exist.
    3. Unzip the PhoneGap download and locate the Android subdirectory.
    4. Copy the three PhoneGap library files for Android to the following Eclipse project folders:
      • Copy phonegap-1.0.0.jar to \libs\phonegap-1.0.0.jar
      • Copy phonegap-1.0.0.js to \assets\www\phonegap-1.0.0.js
      • Copy xml/plugins.xml to \res\xml\plugins.xml
    Even though the PhoneGap JAR file is copied into the project, you also need to add it to the project's build path.
    1. Select Project > Properties > Java Build Path > Libraries > Add JARs….
    2. Add phonegap-1.0.0.jar by navigating to it in the project, as shown in Figure 11:
    Figure 11. Adding PhoneGap JAR
    Adding PhoneGap JAR
    The final step in preparing the example Android application to use PhoneGap is to modify App.java. Because a PhoneGap application is written in HTML and JavaScript, you need to change App.java to load your HTML file using loadUrl(), as shown in Listing 2. You can edit App.java by double-clicking on App.java in the tree view shown in Figure 10.
    Listing 2. App.java
    Package com.ibm.swgs;
    import android.os.Bundle;
    import com.phonegap.*;
    public class App extends DroidGap //Activity
    {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.main);
    super.loadUrl("file:///android_asset/www/index.html");
    }
    }

    Write the PhoneGap application

    You're now ready to start writing the PhoneGap application. For Android, files under the asset directory are referenced using file:///android_asset. As specified in loadUrl() in Listing 2, you need to create an index.html file under assets/www.
    After creating index.hml, enter the contents of Listing 3 below.
    Listing 3. index.html
    <!DOCTYPE HTML>
    <html>
    <head>
    <title>PhoneGap</title>
    <script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script>
    </head>
    <body onload='document.addEventListener("deviceready", deviceInfo, false);'>
    <script>
    function deviceInfo() {
    document.write("<h1>This is Phonegap 1.0.0 running on "+device.platform+"
    "+device.version+"!</h1>");
    }
    </script>
    </body>
    </html>
    A brief explanation of index.html is in order. Before calling any PhoneGap APIs, we must wait for the deviceready event, which indicates that the native portion of PhoneGap has been initialized and is ready. In Listing 3, the onload callback registers for deviceready. When it fires, we write out the device's OS and version.
    Since PhoneGap uses native features that are protected by permissions, you need to modify AndroidManifest.xml to include these uses-permission tags. You also need to specify the support-screens tag, the android:configChanges property, and the com.phonegap.DroidGap activity tag, as shown in Listing 4:
    Listing 4. AndroidManifest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ibm.swgs"
    android:versionCode="1"
    android:versionName="1.0">
    <supports-screens
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:resizeable="true"
    android:anyDensity="true"
    />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".App"
    android:label="@string/app_name"
    android:configChanges="orientation|keyboardHidden">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <activity android:name="com.phonegap.DroidGap" android:label="@string/app_name"
    android:configChanges="orientation|keyboardHidden">
    <intent-filter>
    </intent-filter>
    </activity>
    </application>
    </manifest>

    Run the application in the Android emulator

    The PhoneGap application is now ready to run. Select Run > Run As > Android Application, and you should see something similar to Figure 12
    Figure 12. Android emulator
    Screenshot of Android emulator and message 'This is PhoneGap 1.0.0 running on Android 2.2!'
    Eclipse automatically builds the application, launches the emulator, and installs and runs it on the emulator.
    The emulator can take several minutes to start up. To speed development, keep the emulator running until you are done with your development session. Eclipse will automatically use a running emulator instead of launching a new one.

    Get products and technologies

    Source:IBM

    Common android developer interview question and anwers

    Here is common interview asked during interview .

    What is Android?
    #  It is an open-sourced operating system that is used primarily on mobile devices, such as cell phones and tablets.
    It is a Linux kernel-based system that’s been equipped with rich components that allows developers to create and run apps that can perform both basic and advanced functions.

    Explain in brief about the important file and folder when you create new android application.

    # When you create android application the following folders are created in the package explorer in eclipse which are as follows:

    src: Contains the .java source files for your project. You write the code for your application in this file. This file is available under the package name for your project.

    gen —This folder contains the R.java file. It is compiler-generated file that references all the resources found in your project. You should not modify this file.

    Android 4.0 library: This folder contains android.jar file, which contains all the class libraries needed for an Android application.

    assets: This folder contains all the information about HTML file, text files, databases, etc.

    bin: It contains the .apk file (Android Package) that is generated by the ADT during the build process. An .apk file is the application binary file. It contains everything needed to run an Android application.

    res: This folder contains all the resource file that is used byandroid application. It contains subfolders as: drawable, menu, layout, and values etc.

    What is an Activity?
    # A single screen in an application, with supporting Java code.

    What is an Intent?
    # A class (Intent) which describes what a caller desires to do. The caller will send this intent to Android’s intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF document is an intent, and the Adobe Reader apps will be the perfect activity for that intent (class).

    What is the Android Architecture?
    #  Android Architecture is made up of 4 key components:
    - Linux Kernel
    - Libraries
    - Android Framework
    - Android Applications


    How do you handle multiple resolution screens in android?

    # The following five properties help you to achieve multiple resolution screens in android:

        Screen size – Screen sizes are divided into four generalized sizes: small, normal, large, and extra-large.
        Screen density – Screen densities are also divided into four generalized densities: low, medium, high, and extra-high.
        Orientation – When user rotates the device the orientation of the device also gets changed.
        Resolution – The total number of physical pixels on a screen.
        Density – independent pixel (dp) – Provides you a density-independent way to define your layouts.

    What is a resource?
    # A user defined JSON, XML, bitmap, or other file, injected into the application build process, which can later be loaded from code


     What is an Explicit Intent?
    #
    - Explicit intent specifies the particular activity that should respond to the intent.
    - They are used for application internal messages.

     What is an Implicit Intent?
    #
    - In case of Implicit Intent, an intent is just declared.
    - It is for the platform to find an activity that can respond to it.
    - Since the target component is not declared, it is used for activating components of other applications.


    What is the role of Orientation?

    # Orientation is used to determine the presentation of LinearLayout. It may be presented in rows or columns.


    What is adb?
    #  Adb is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.


    What is Dalvik Virtual Machine?
    #
    - It is Android's virtual machine.
    - It is an interpreter-only virtual machine which executes files in Dalvik Executable (.dex) format. This format is optimized for efficient storage and memory-mappable execution.

    What are the different states wherein a process is based?
    #  There are 4 possible states:
    - foreground activity
    - visible activity
    - background activity
    - empty process

    What is the APK format?
    # The APK file is compressed AndroidManifest.xml file with extension .apk. It also includes the application code (.dex files), resource files, and other files which are compressed into a single .apk file.

    What is the AndroidManifest.xml?
    # This file is essential in every application. It is declared in the root directory and contains information about the application that the Android system must know before the codes can be executed.

    What is a Fragment?
    # A fragment is a part or portion of an activity. It is modular in a sense that you can move around or combine with other fragments in a single activity. Fragments are also reusable.

    Describe Briefly the Android Application Architecture
    # Android Application Architecture has the following components:

        Services like Network Operation
        Intent – To perform inter-communication between activities or services
        Resource Externalization – such as strings and graphics
        Notification signaling users – light, sound, icon, notification, dialog etc.
        Content Providers – They share data between applications

    How make weblink(hyperlink) in textview in android

    Weblink or Hyperlink in textview, simple way to make it:

    Textview tv_link= (Textview)findViewById(R.id.tvLink);
    tv_link.setText("prandroid@gmail.com");
    Linkify.addLinks(tv_link, Linkify.ALL);

    or may be use this also:

    TextView tvLinkTest= (TextView) findViewById(R.id.tl);
    tvLinkTest.setMovementMethod(LinkMovementMethod.getInstance());

    next alternative method is:

    <TextView
    android:text="www.hello.com"
    android:id="@+id/TextView01"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:autoLink="web">
    </TextView>

    Happy Coding!!!

    Display Second Largest number in java

    Displaying second largest number in string array in java.

    Here is the full source code, how to display second largest number in integer array ,
    public class One {
    public static void main(String[] args) {

            int arr[] = {5,8,0,7,12};
         
            System.out.println("SortedSet = second largest number is--->"+displaySecond(arr));
           
    }

    private static int displaySecond(int[] arr1) {
    if (arr1.length==0 || arr1.length==1) {
            return -1;
            }else {
            SortedSet<Integer> set = new TreeSet<Integer>();
            for (int i: arr1) {
                set.add(i);
            }
            // Remove the maximum value; print the largest remaining item
            set.remove(set.last());
            return set.last();
    }
    }
    }

    Output looks like:

    SortedSet = second--->8

    Happy Coding!!!


    Press back and Exit app in androird


    If you getting trouble when pressing back don't exit app, then this article will help you. Here first time your will display toast message, please press again for exit app.

    here is the full source code:

    public class MainActivity extends Activity {
    private static long back_pressed;
    private Toast toast;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    }

    @Override
    public void onBackPressed() {

    if (back_pressed + 2000 > System.currentTimeMillis()){
    // need to cancel the toast here
    toast.cancel();
    // code for exit
    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_HOME);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    }else{
    toast = Toast.makeText(getBaseContext(), "Please click BACK again to exit", Toast.LENGTH_SHORT);
    toast.show();
    }
    back_pressed = System.currentTimeMillis();
    }

    Output looks like:



    Happ Coding!!
    }

    Refresh activity on back button in android


    Normally, when user click the back button in android, the next view is not refreshed. I had this problem when I was doing the settings. if user changed the some settings and hit back button, the new settings won’t be applied to the “back” list view since all the cells are reused.
    you can do some scroll to refresh the list view but that is definitely not something we wanna user to do.
    first solution is to override the onResume method in the back view, but it is not guaranteed to work in listView.
    However the following code should do the work:

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK && isNightModeToggled) {
            Intent a = new Intent(this,MainActivity.class);
            a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(a);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

    Happy Coding!!!!

    Programmatically Displaying the Settings of device


    Sometimes, you want to set wifi, bluetooth and others setting then from programmatically do things here in your code

    you can use the startActivity()
    method together with an Intent object. The following shows some examples:

        //---display the main Settings page---
        startActivity(
            new Intent(Settings.ACTION_SETTINGS));
           
        //---display the Location access settings page---
        startActivity(new Intent(
            Settings.ACTION_LOCATION_SOURCE_SETTINGS));
                   
        //---display the Wireless & networks settings page---
        startActivity(new Intent(
            Settings.ACTION_AIRPLANE_MODE_SETTINGS));
           
        //---display the Bluetooth settings page---
        startActivity(new Intent(
            Settings.ACTION_BLUETOOTH_SETTINGS));
           
    Output Looks Like:

            In general, you use the predefined constant Settings.ACTION__SETTINGS.
    The full list can be found here: http://developer.android.com/reference/android/provider/Settings.html

    Happy Coding!!!