Programming/Non programming

Monday, March 31, 2014

Android build error: Call requires API level 14 current min is 8 ...

Android:


Issue

Call requires API level 14 current min is 8 ...

Solution:
It is due to API version level issue. You added latest API, but your program couldn't find it to support for multiple versions, even though you have that version SDK installed.

So,

Just add @SuppressLint("NewApi") just before onCreate() method.

For example like this:

@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // TODO Auto-generated method stub
    setContentView(R.layout.myActivity);

}

Thank you!

Cheers!

Prabakar

Android build error: R cannot be resolved

Android:


Issue:

R cannot be resolved

Solution:

When I observed "R cannot be resolved" error with the most of the existing solution given, i found making sure, all the res/* filenames should be named with lowercase character, underscore and number between 0 and 9, was the typical fix for me.


Thank you!

Cheers!

Prabakar

Sunday, March 9, 2014

How to solve device not shown when installing Android app on the device through Eclipse development?

How to solve device not shown when installing Android app on the device through Eclipse development?

Issue:

Device is not listed when installing Android project on the Android device via Eclipse development using "Run As"/"Debug As" option.

Solution:

One of the important solutions for this issue is, Go to your Android device "Settings -> Developer Options-> USB Debugging" and enable it.


Saturday, March 8, 2014

How to Debug An Android application through Eclipse?

How to Debug An Android application through Eclipse?

1. Open "AndroidManifest.xml" of your Android project in Eclipse.
2. Choose "Application" tab
3. Change "Debuggable" option as "true"

4. Go to your project source files and identify the lines where you want to debug, and add break point by enabling "Toggle breakpoint" from "Run" menu (or) Right click the left most area in the source file to enable "Toggle breakpoint" option.
5. Right click project "Debug As" -> "Android Application"

When the application is running, automatically it will stop at debug points. You can verify logs in LogCat.

Hope, it will help someone!

Thank you Guys!

Regards,

Prabakar. M.P

Technical Architect




How to stop the android application running on the device through eclipse

Stopping android app:

When you are running your android application in the emulator of Android, you always can stop it by closing the emulator. But, to stop it running on the device through Eclipse, you can find the better following way,

1. On the top right side of Eclipse, you can see an icon with the symbol of Andoid and some character "DDMS". Press it.
You can do the same pressing:
Windows -> Open perspective -> Other... -> DDMS

2. In the Android view, on the left windows, you can see "Devices". There should be a list of applications that is running now (Emulator or physical devices).
Click on the application you want to close. 
3. Now click on the symbol of "Stop".

To come back to the normal view, you just have to press on the Java button on the top right side.
You can also do it pressing:
Windows -> Open perspective -> Other... -> Java 

Hope it finds some help to someone :)

Cheers,

-Prabakar M.P
Technical Architect.