Showing posts with label Error Handling. Show all posts
Showing posts with label Error Handling. Show all posts

Thursday, August 02, 2012

Error when implementing AdMob into existing Android app



After a successful application of AdMob, next step to start your Ads business is integrate the AbMob into your apps. I am not going through the detail as, its really simple for person who can write your own apps.

I just want to share some experience during the implementation,  especially when your existing apps are developed based on Android 2.3 or prior version.

if you following the guideline from Google AdMob, you may get the following error

<activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"></activity>


error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').


When your are using AdMob V6+, you apps SDK must be Android 3.2 (target SDK 13) or above. For new I recommend you to use Android SDK 4.0.3 (SDK 15), as Android 3.2 was for Tablet.

1. In AndroidManifest.xml, make the changed as below. remeber to setup your minSdkVersion, or your existing coding may not be run.



    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="15"/>

 2. Make the following changes in "project.properties" file
 
 
 
# Project target.
target=android-15


Please note after the implementation. you lay out will have become Android 4.0 stylus. UI appearance may be changed.




Tuesday, July 31, 2012

"unable to resolve target" and "Unable to get system library for the project"

Have you even tried to import an Android Project into Eclipse, but get error like "unable to resolve target" and "Unable to get system library for the project" ? If so, this post may help.




 In sometimes, the error was caused by unavailable of certain Android SDK version. The project may be build based on a version of Android SDK, that your Eclipse had not installed.

To solve the issue, just following the steps below.

1. In Eclipse, right click your project > Properties.
2. Click Android, select a build target and "ok"
3, When you go back to Eclipse, clokc, Project > Clean > Clean all projects

Then back to your .java and all error should be removed.

p.s. The nice example was came from How to convert an Activity class to use with FragmentPagerAdapter

Monday, July 30, 2012

"R cannot be resolved" error

For "R cannot be resolved" error, in most cases, the problem may relied on the Java itself, but /res/values/strings.xml. Make sure the syntax of XML is correct.