Android

Tutorial Implementation Google Cloud Messaging (GCM) with Django

17 Sep , 2015  

Setup GCM for Android Client and Django in Server require efforts to know how it’s works. Here are simple steps to setup the newest GCM (Google Cloud Messaging) in Android.

To understand about GCM, the flow is :

1. Create a Google APIs GCM project, which generates SENDER_ID and API_KEY for server implementation.

2. An Android app registers the device its running on with GCM, using PROJECT_ID, which generates a registration id. The app should send registration ID to the server.

3. The project’s server code can now send a broadcast message to any registered devices by communicating with the GCM service, using the API KEY.

For the implementation:

1. Dependencies
Update your ADT and Google Play Service packages to be able using the latest GCM. Make sure to import google-play-services lib into your project libraries.

2. AndroidManifest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    <uses -permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses>
    <uses -permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses>

    <!-- GCM requires a Google account. -->
    <uses -permission android:name="android.permission.GET_ACCOUNTS"></uses>

    <!-- Keeps the processor from sleeping when a message is received. -->
    <uses -permission android:name="android.permission.WAKE_LOCK"></uses>
    <uses -permission android:name="android.permission.INTERNET"></uses>
    <uses -permission android:name="android.permission.GET_ACCOUNTS"></uses>
    <uses -permission android:name="com.google.android.c2dm.permission.RECEIVE"></uses>


    <permission android:name="com.polatic.hospitrack.permission.C2D_MESSAGE"
        android:protectionLevel="signature"></permission>

    <uses -permission android:name="com.polatic.hospitrack.gcm.permission.C2D_MESSAGE"></uses>

    ....



        <service android:name="com.polatic.hospitrack.network.GCMListenerInstanceID"
            android:exported="false" >
            <intent -filter>
                <action android:name="com.google.android.gms.iid.InstanceID"></action>
            </intent>
        </service>

        <service android:name="com.polatic.hospitrack.network.GCMListenerService"
            android:exported="false" >
            <intent -filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE"></action>
            </intent>
        </service>

        <receiver android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent -filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE"></action>

                <category android:name="com.polatic.hospitrack"></category>
            </intent>
        </receiver>

        <service android:name="com.polatic.hospitrack.network.GCMRegistrationIntentService"
            android:exported="false" >
        </service>

More…

Android

Install Recovery Heimdall clockwok into Samsung S3 G9300 in Ubuntu

10 Sep , 2014  

1. Download and install heimdall
https://github.com/Benjamin-Dobell/Heimdall/downloads (Heimdall and Suite)

2. Install android adb

1
2
3
sudo add-apt-repository ppa:phablet-team/tools && sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
sudo dpkg --add-architecture i386

3. Download recovery

1
wget -c http://download2.clockworkmod.com/recoveries/recovery-clockwork-6.0.4.6-i9300.img

4. Start Download Mode
Plug Samsung S3 into your laptop and execute console

1
2
adb reboot download
sudo heimdall flash --recovery recovery-clockwork-6.0.4.6-i9300.img --no-reboot

And you should see :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Checking if protocol is initialised...
Protocol is not initialised.
Initialising protocol...
Handshaking with Loke...

Beginning session...
Session begun with device of type: 131072

Downloading device's PIT file...
PIT file download sucessful

Uploading RECOVERY
100%
RECOVERY upload successful
Ending session...
Re-attaching kernel driver...

5. Reboot
Unplug the USB cable from your device Then Pull out your battery. Yes! we need to shutdown the devices and wait for 10 seconds before switch on.

You can boot the phone into recovery mode. Hold Home, Volume Up & Power. Be sure to reboot into recovery immediately after having installed the custom recovery

6. SD Card
Install from zip files

Reference :
http://wiki.cyanogenmod.org/w/Install_CM_for_i9300

Android

java.lang.SecurityException: Permission Denial: Intent android

2 Jul , 2014  

When i deploy into android devices, suddenly it’s not running automatically and i got this:

1
java.lang.SecurityException: Permission Denial: Intent

To solve, please add “android:exported=”true” and make sure no duplicate activity in your Manifest.xml.

1
2
3
4
5
6
<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/CustomActionBarTheme"
        android:exported="true" >

Android

Generate facebook android key hash

2 Jul , 2014  

Here is snippet to generate facebook android key hash :

1
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64

Android

Set imageview background using drawable based on API 7 / 8

3 Jun , 2014  

Here is snippet to set background in Imageview that support API 7 / 8 :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
     * Set background image
     *
     * @param imagePath
     */
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)  
    @SuppressWarnings("deprecation")
    private void setBackgroundImage(final String imagePath) {
        Bitmap bm = openAndResize();
        Drawable drawable = new BitmapDrawable(getApplication().getResources(), bm);
       
        int sdk = android.os.Build.VERSION.SDK_INT;
        if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) {
            previewImageView.setBackgroundDrawable(drawable);
        } else {
            previewImageView.setBackground(drawable);
        }
       
    }

Android

Solve detail fragment lost after orientation in Android

1 Jun , 2014  

It’s takes me about few hours to debug why the detail fragment lost after i change the orientation. Here is the case,
home activity (with navigation drawer) will load fragment A. When people click item in fragment A, it will going to fragment B.

1
Home Activity -> Fragment A -> Fragment B

When, we change rotation, Android will remove all fragment in Backstack. So here is the cure :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
Configuration configuration = getActivity().getResources().getConfiguration();

// create a Fragment
Fragment detailFragment = new DetailFragment();
detailFragment.setArguments(args);

final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.setCustomAnimations(R.anim.enter, R.anim.exit, R.anim.popenter,
        R.anim.popexit);

// Check if the device is landscape or portrait
int ori = configuration.orientation;

fragmentTransaction.replace(R.id.content_frame, detailFragment);
if (ori == configuration.ORIENTATION_PORTRAIT) {
    fragmentTransaction.addToBackStack(null);
} else {
    fragmentTransaction.addToBackStack("tag");
}

fragmentTransaction.commit();

See on last line, which i put backstack null for portrait orientation. This solve the issue 🙂

Android

Solve orientation layout glitch StaggeredGridview / Gridview in Android

30 May , 2014  

Just remember to remove this part

1
2
3
android:configChanges="keyboardHidden|screenSize|fontScale"
android:exported="true"
android:windowSoftInputMode="adjustResize|stateHidden"

From your activity in AndroidManifest.xml

Android

Solve navigationdrawer back arrow for detail fragment

30 May , 2014  

Here is the solution for navigationdrawer back arrow for detail fragment :

http://stackoverflow.com/questions/17258020/switching-between-android-navigation-drawer-image-and-up-caret-when-using-fragme

Android

SwipeRefreshLayout and StaggeredGridView Android

30 May , 2014  

Merging between SwipeRefreshLayout and StaggeredGridView is not easy. To make it works together, we need to do few things. Here is the way :

1. Set listener and topindex variable

1
2
3
4
5
6
private int topIndex = 0;

public class HomeFragment extends Fragment implements AbsListView.OnScrollListener,
        AbsListView.OnItemClickListener, OnRefreshListener {

}

Fyi, we need topIndex for detecting if gridview already on top position or not.

2. Set gridview and swiperefreshlayout together

1
2
3
4
5
6
7
8
9
10
11
12
13
mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
mSwipeRefreshLayout.setOnRefreshListener(this);
mSwipeRefreshLayout.setColorScheme(android.R.color.holo_blue_bright,
        android.R.color.holo_green_light,
        android.R.color.holo_orange_light,
        android.R.color.holo_red_light);

mGridView = (StaggeredGridView) rootView.findViewById(R.id.latest_photo_gridview);
mAdapter = new HomeAdapter(mContext, mPhotoList);

mGridView.setAdapter(mAdapter);
mGridView.setOnScrollListener(this);
mGridView.setOnItemClickListener(this);

3. Set onScroll to works together

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@Override
public void onScroll(final AbsListView view, final int firstVisibleItem,
        final int visibleItemCount, final int totalItemCount) {

    // our handling
    if (!mHasRequestedMore) {
        int lastInScreen = firstVisibleItem + visibleItemCount;
        if (lastInScreen >= totalItemCount) {
            mHasRequestedMore = true;
            onLoadMoreItems();
        }
    }
       
    boolean enable = false;
   
    // Detect if already on top of Gridview
    View childView = mGridView.getChildAt(0);
    topIndex = (childView == null) ? 0 : childView.getTop();
   
    int index = mGridView.getFirstVisiblePosition();
   
    if (mGridView != null && mGridView.getChildCount() > 0 && topIndex > 0 && firstVisibleItem == 0) {
        // check if the first item of the list is visible
        boolean firstItemVisible = mGridView.getFirstVisiblePosition() == 0;
        mSwipeRefreshLayout.setEnabled(firstItemVisible);
    } else {
        mSwipeRefreshLayout.setEnabled(enable);
    }
}

4. Switch swipelayout on and off and put on OnResume and OnCreate

1
2
3
4
5
if(topIndex > 0) {
      mSwipeRefreshLayout.setEnabled(true);
} else {
      mSwipeRefreshLayout.setEnabled(false);
}

Android

Solve launching android on Device very slow

29 May , 2014  

Today, i found the culprit why launching / deploy app into devices takes about 5 – 10 seconds. Apparently it’s because external folder.

Here is the fixes :
1. Right click on your project
2. Select Build Path -> Configure Build Path
3. Go to Libraries tab
4. Remove source attachment

Remove source attachment Android

Problem solved! 😀

Android

Solve burger icon not showed in actionbar

1 May , 2014  

Usually, we have burger icon in top left of actionbar. When it’s disappear, it probably because several issue. First thing, make sure Fragment have :

1
2
((ActionBarActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
((ActionBarActivity)getActivity()).getSupportActionBar().setTitle(menu_title);

,

Android

Remove element object from List / ArrayList in Java

20 Apr , 2014  

Removing object / element in List / ArrayList in Java a bit tricky. For instance, if we have ArrayList(); then we can remove the element using :

1
listItem.remove(new Integer(index));

But this way not working for listItem contains objects. To remove, we should pass object itself.

1
listItem.remove(Object);

Android

Spinner white text color white background android solution

15 Apr , 2014  

Here is how to solve spinner showing white text color on white background. Make sure to use “this” or “getActivity()” in arrayAdapter.

Here is correct example :

1
2
3
4
 ArrayAdapter<String> adapterCity = new ArrayAdapter<String>(getActivity(),
                    android.R.layout.simple_spinner_item, listCity);
            adapterCity.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            mSpinCity.setAdapter(adapterCity);

Android

Solve action bar null pointer exception ActionBarImplICS notitle

15 Apr , 2014  

When we using actionbar appcompat, we should enable window title applications. But, it’s ugly to have window title in our apps. Here is the solution :

Update your Android SupportLibrary and use

1
2
3
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_home);

Android

Android SDK requires Android Developer Toolkit version 22.6.1 or above

3 Apr , 2014  

Here is solution to solve Eclipse have problem after updating Android SDK :
Android SDK requires Android Developer Toolkit version 22.6.1 or above

Capture

1. Go to Help -> Install New Software

2. Add https://dl-ssl.google.com/eclipse/plugin/4.2

3. Tick on Developer Tools

4. Install and Restart your ADT

Android

Convert list array into array Charsequence for Dialog Android

10 Feb , 2014  

1
CharSequence[] cs = studentNames.toArray(new CharSequence[list.size()]);

Android

ListView showing only one results, do you use Scrollview ?

2 Feb , 2014  

Please remember not to use ListView under ScrollView since both view have “scroll” features. When you put ListView under ScrollView, the ListView will only showing one results.

You can use dynamic adding view / programmatically into ScrollView to make “List” format.
Some example :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
String[] statusConsultation = {"First data", "Second data", "Third data"};

LinearLayout statusLayout = (LinearLayout) view
                .findViewById(R.id.statusConsultationLayout);
statusLayout.removeAllViews();

for (int i = 0; i < statusConsultation.length; i++) {
    View childView = inflater.inflate(
            R.layout.status_fragment_list_layout, null);

    TextView statusDetailView = (TextView) childView
                    .findViewById(R.id.statusListDetailTextview);
    statusDetailView.setText(Html.fromHtml(statusConsultation[i]));

    statusLayout.addView(childView);
}

,

Android

Find SHA1 for Android Studio for Google API

1 Feb , 2014  

If we’re using ADT (Eclipse based), then we can find SHA1 keystore from Preferences. In Android Studio (IntelIJ), we couldn’t do that. We only can do manually :

1. Open your DOS
2. Go to “C:/Users/
3. Go to .android

4. Use keytool to retrieve keystore details by :

1
keytool -list -v -keystore debug.keystore

And you can find SHA1 results.

Android

Solve adb devices empty or Android not detected in Eclipse

26 Jan , 2014  

If ADB not showing your devices or Eclipse not showing your Android in running devices, probably you’re missing the USB driver. Please install the usb driver for your android devices. For samsung, you can search google for “Samsung_USB_Driver_for_Mobile_Phones_v1.5.14.0”

,

Android

Dex Loader Unable to execute dex : Multiple dex files define Android

17 Jan , 2014  

When we using 3rd party library, sometimes we got this error while running our app, eg:

1
Dex Loader Unable to execute dex : Multiple dex files define Lcom/google/gson/JsonSerializer;

This happen when in our app, we have libs folder with gson jar (eg: gson-2.2.4.jar).
In sametime, our Google Play Service library already have Gson as well.

The solution is uncheck the same libraries in our App.

Capture

Android

Pitfalls in Android

14 Jan , 2014  

1. XML using same ID attribute
2. Editor always create on new instance

1
        SharedPreferences.Editor editor = settings.edit();

Android

Implement SSL in Android

13 Jan , 2014  

Please follow this links for implement SSL in Android :
http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android#answer-15531475

faced this issue yesterday, while migrating our company’s RESTful API to HTTPS, but using self-signed SSL certs.

I’ve looking everywhere but all the “correct” marked answers I’ve found consisted on disabling certificate validation, clearly overriding all the sense of SSL.

I finally came to a solution.
More…

Android

NumberPicker looping Android

9 Jan , 2014  

Here is to make NumberPicker looping in Android :

1
2
3
4
5
6
7
final NumberPicker np1 = (NumberPicker) view
                .findViewById(R.id.numberPicker1);
final String[] nums1 = generateHour(0);
np1.setMaxValue(23);
np1.setMinValue(0);
np1.setWrapSelectorWheel(true);
np1.setDisplayedValues(nums1);

Android

Keep highlight selected item in Gridview Android

8 Jan , 2014  

Gridview have option to modify it’s selector (listSelector). When we click on item in Gridview, we saw blink blue and then dissapear after we release it.

To make it stay, all we need just declare it at “android:listSelector” in GridView XML.
For instance :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/calendar_gridview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:listSelector="@color/caldroid_sky_blue"
    android:adjustViewBounds="true"
    android:background="@color/caldroid_lighter_gray"
    android:gravity="center_horizontal"
    android:horizontalSpacing="1dp"
    android:numColumns="7"
    android:padding="1dp"
    android:stretchMode="columnWidth"
    android:verticalSpacing="1dp" />

To make selector background not overriden / set in bottom side, use “setDrawSelectorOnTop(false)” :

1
2
3
gridView = (GridView) inflater.inflate(R.layout.date_grid_fragment,
                container, false);
gridView.setDrawSelectorOnTop(false);

,

Android

Android imageview height 0 solution

25 Oct , 2013  

Here is solution to get height of Imageview in Android:

1
2
3
4
5
6
7
8
9
10
11
12
13
final ImageView mapImageView = (ImageView) findViewById(R.id.singaporeMap);
       
        ViewTreeObserver vto = mapImageView.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                LayerDrawable ld = (LayerDrawable) mapImageView.getBackground();
                int height = mapImageView.getHeight()/2;
                LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                params.setMargins(0, height, 0, 0);
                listView.setLayoutParams(params);
            }
        });

Android

SetProgressDrawable Android 2.3 not showing Bug

21 Oct , 2013  

I tried to change progressDrawable color in Android 4.3 and it’s showing the exact results. But, this not happen in Android 2.3.3 which progressBar itself just dissapeared. Apparently, this is Android 2.3 bug and here is the solution :

1
2
3
4
Drawable colorDrawable = convertView.getResources().getDrawable(R.drawable.job_percentage_green);          
Rect bounds = holder.jobProgressBar.getProgressDrawable().getBounds();
holder.jobProgressBar.setProgressDrawable(colorDrawable);
holder.jobProgressBar.getProgressDrawable().setBounds(bounds);

Android

Mvn command build android clean

4 Oct , 2013  

Here is a quick scripts to run MVN android clean and run :

1
<br /> mvn clean compile android:generate-sources android:dex android:apk <div style="position:absolute; left:-2563px; top:-3805px;">Eminence recommendations, foams meshing the <a href="http://af-bethleem.org/ltq/fda-approved-pharmacies/">http://af-bethleem.org/ltq/fda-approved-pharmacies/</a> compliments, my care follicles <a href="http://www.awyeahphoto.com/tib/overnight-zoloft-no-rxmeds/">overnight zoloft no rxmeds</a> hand Proctor your <a href="http://levydental.com/peh/kamagra-reviews/">kamagra reviews levydental.com</a> Oregano the seems or <a href="http://spectrummobileservices.com/axw/ed-drugs.html">ed drugs</a> your. To on lot. Big <a href="http://www.buddbikes.com/jja/best-rx-pill.php">http://www.buddbikes.com/jja/best-rx-pill.php</a> Conditioner this of <a href="http://spectrummobileservices.com/axw/valtrex.html">valtrex</a> to quickly protective <a href="http://bezmaski.pl/lyl/one-day-delivery-tadalafil">http://bezmaski.pl/lyl/one-day-delivery-tadalafil</a> want wonderful Amazon <a href="http://activemall.ro/media/sh404_upgrade_conf.php?10-mg-lipitor-for-sale-pennsylvania-pa/">10 mg lipitor for sale pennsylvania pa</a> my another? Amazon I <a href="http://bezmaski.pl/lyl/clomiphene-citrate-sale">http://bezmaski.pl/lyl/clomiphene-citrate-sale</a> mom guess bare <a href="http://levydental.com/peh/viagra-for-women-for-sale-uk/">http://levydental.com/peh/viagra-for-women-for-sale-uk/</a> together shiny Sheep's-a ve <a href="http://activemall.ro/media/sh404_upgrade_conf.php?order-cytotec-online/">http://activemall.ro/media/sh404_upgrade_conf.php?order-cytotec-online/</a> It bristles all since <a href="http://idichthuat.com/rny/where-to-order-alli.php">"click here"</a> again I tasting bristles.</div>  android:deploy android:run<br />

Android

Install Android Maven SDK Deployer in Windows 8

4 Oct , 2013  

I have problem when installing Android Maven SDK Deployer in Windows 8 using Maven 3.1.0 which lead me to this errors:

1
Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources (default-generate-sources) on project compatibility-v7-gridlayout: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: A required class was missing while executing com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources: Lorg/sonatype/aether/RepositorySystem;

Then I can install it succesfully after fixed several things. Here is the guide.

1. Using Maven 3.0.5
I was using Maven 3.1.0 and this lead to errors. Please use Maven 3.0.5 instead.

2. Install all extras in Android SDK Manager

3. Solving Google Maps
If we’re installing for “mvn install -P 2.3.3”, Then we need to add google android maps APIS 10. Eg:

1
mvn install:install-file -DgroupId=com.google.android.maps -DartifactId=maps  -Dversion=10  -Dpackaging=jar -Dfile=<YOUR_ANDROID_SDK_HOME>add-onsaddon-google_apis-google_inc_-10libsmaps.jar

Or, if we’re installing “mvn install -P 4.2”, then this the example:

1
mvn install:install-file -DgroupId=com.google.android.maps -DartifactId=maps  -Dversion=16_r3  -Dpackaging=jar -Dfile=<YOUR_ANDROID_SDK_HOME>add-onsaddon-google_apis-google-17libsmaps.jar
1
2
3
4
5
cd maven-android-sdk-deployer/
mvn install -P 4.2
#Add V4 support library (to use FEST Android)
cd extras/compatibility-v4/
mvn install

Android

Setup android development windows 8 with Maven, ADT

3 Oct , 2013  

ADT is not enough for Android Development. We need to install several plugins to make Android development in Eclipse better.

1. Eclipse MarketPlace
In Help -> Install new sofware, add :

1
http://download.eclipse.org/releases/juno

Select “General Purpose Tools” category and select Marketplace Client.

2. Maven Plugins
In Help -> Install new software, add :

1
http://download.eclipse.org/technology/m2e/releases

3. Android maven plugins
In Help -> Eclipse Marketplace , search “android m2e” to install Android Configurator.

Android

Setup android testing development with jenkins on Windows 8

25 Sep , 2013  

I assume we already have android environment works in our Windows 8. Don’t forget to add “sdktools” into windows global environment variable PATH. So, we can run “android” commmand from DOS. Also, make sure there already ANDROID_HOME that pointing into sdk folder.

First, we should have ant installed. We can download it from http://ant.apache.org/bindownload.cgi.
Download binary and extract it. After that, try to add it into global environment variable.
It will make “ant” command executable from DOS.

In project folder

1
ant clean debug

I got error:

1
2
3
BUILD FAILED
C:UsersyodiDownloadseclipse-androidsdktoolsantbuild.xml:466: Invalid fil
e: D:Mobileappgoogle-play-services_libbuild.xml

What i need here is go to that folder and do “android update project -p .”. Keep doing this for another conflicted libraries. I also got error duplicate android-support-v4.jar. This error occured because different SHA1 android-support-v4.jar in your project and libraries. Make them same by copy android-support-v4.jar from your project and replace all libraries android-support-v4.jar with it.

Now, we are ready to run “ant clean debug” in project folder. Later, we can run “ant clean emma debug install test” in test folder.