android - admob implmetation confusion - android

I have implemented admob code as given in google site (http://code.google.com/mobile/ads/docs/android/fundamentals.html) as described in google site we should target android 3.2 (api-13) in eclipse IDE to work properly. now my problem is my application targeting the android version 1.6 and above, since i made build target as andoird 3.2 it expects app should run on either 3.2 emulator or any of 3.2 device. i tried even installing on my 2.2 device but it didnt work.
Please help.
Thanks

The only thing you need to do is follow their instruction:
Requirements
The Google AdMob Ads SDK for Android requires Android 1.5 or later. Make sure you have the latest copy of the Android SDK and that you're compiling against at least Android v3.2 (set target in default.properties to android-13).
Using Android SDK Tool download android-13 SDK and modify your default.properties, do not change anything else like android:minSdkVersion in AndroidManifest.xml. Yes, you will get a little yellow warning message says version not match in Eclipse, just ignore it and build your application, you should be fine.

Related

New Android App ( Xamarin) targeting Android 9.0 api not compiling because missing Android X assemblies (but they need Android 11.0 version)

I am trying to build an Android app to make a simple prototype. Using Microsoft Visual Studio 2022 (v17.2.4), I create an Android App (Xamarin), blank app. And I target Android 9.0 version.
But, I have compilation errors :
Could not find 2 Android X assemblies, make sure to install the following NuGet packages:
Xamarin.AndroidX.Lifecycle.LiveData
Xamarin.AndroidX.Browser
Problem is that I can't install these NuGet packages because they need Android 12.0 version or greater :
Package Xamarin.AndroidX.Lifecycle.LiveData 2.5.1 is not compatible with monoandroid90 (MonoAndroid,Version=v9.0). Package Xamarin.AndroidX.Lifecycle.LiveData 2.5.1 supports:
monoandroid12.0 (MonoAndroid,Version=v12.0)
net6.0-android31.0 (.NETCoreApp,Version=v6.0)
So I don't know how to solve this. I don't want to target Android 12 version, I need this app to launch on an Android 9.0 device.
What are these libraries the app need to compile? Can I do without them? I don't find any references to them.
Note : I have a warning too on the same way, but not sure if it has to deal with my compilation issue. I Put it anyway, if it can help :
Warning Google Play requires that new applications and updates must use a TargetFrameworkVersion of v11.0 (API level 30) or above. You are currently targeting v9.0 (API level 28).
Please, any idea to solve my issue?
I just want to compile and launch an Android (Xamarin) blank app targeting Android 9.0.
Thank you and have a good day,
I'm finding this a problem too. Just deployed an app (Dec 2022) that targeted 28 / 12 and has min version 10 as appears enforced by Google?
Prob is I've got a lot of people wanting to use the app that can't see it because they have ancient phones (9 or earlier - is that 5 years or more). Seems a bit tough? Is there a way to overcome this.
I assume that the today's Xamarin Android project templates are designed to compile with Android 12. I don't think there is a way to build them with Android 9.
I guess we just have to find another older template?
For my part I had finally took an older project I had instead of creating a new project.

Running My First App On Android Studio

I created a project with API level 8 (Android 2.2) and downloaded the 2.2 SDK in the SDK manager. When I run my android project this error was shown:
Error:(47, 21) No resource found that matches the given name: attr 'android:borderlessButtonStyle'.
I searched and found out that the borderless style is available on API level 11 and above so why did the Google Developers Hello World tutorial say to choose Android 2.2 so that all devices can run the app?
I changed the API level to 15 which solved the problem.
My question is why does the Android tutorial say to select 2.2 and then run application?
What should I do to run my first app on Android 2.2?
Download sdk for api level 15 on your sdk manager and then run the app in your emulator. Or even you could have set the target sdk version as 8 in your application. So please change it and then try running your app
Happy coding..
You misunderstood something. You should differentiate between android minimum SDK and the compile and target SDK you can see this link to know the difference.
You should target the latest version in the compile and target SDKs and set your min SDK as you like.
You are now getting this error because your are compiling with an old SDK and you are referring to some of the new APIs that are introduced after this API, they won't be used if you are using an older version, but they will use it in the later versions of the OS because it makes the process easier or getting the look and feel of the new versions of android.
This is happening in one of your libraries and I think it's the appcompat v7 library.

Which android sdk packages are required to be installed and which are not required ? Are all versions of android API required to be installed?

I just installed the android apk and adt plugin for eclipse. Further in the sdk manager , I've installed all the tools , Android 4.4.2(API 19) , Android 2.1(API 7) as well as the android support library and google USB driver. Now what i want to know about is , are these packages enough to start development or am i still missing everything ?
Further what i want to know is, if i want my app to be compatible with all android versions , do i need to install all versions of Android API ??
This should be enough.
No, you just need the newest SDK, set the build target to that API version and all lower versions will be supported. For keeping backwards-compatibility, you'll also have to make sure to use APIs that are supported on the lowest SDK version you want to support
Short answer: You only have to install the ones you want to develop for.
My advice in to install at least the 5 most common ones to be able to test your app against these version.
You probably want your app to be also available for users which didn't yet update to Android 4.4.2.

Installing Android SDK with minimal setup.

I'm new To android ecosystem.
Do I really need to install all the SDK from Android 1.5 to Android 4.1? to create an app which will support almost all the Android versions
No, one should be fine. Pick the latest one. So 4.1 be it!
Just set your apps mininum sdk version to the desired api level.
Eclipse should warn you if you use stuff that aint working on that minumum version.
Do I really need to install all the SDK from Android 1.5 to Android 4.1? to create an app which will support almost all the Android versions
You need to test your app on any version that you intend to support. For those Android versions that you have a physical device for, you can test your app on that (most likely). For anything else, you will at least need to download the emulator images, so you can create emulators for those older Android versions.

What happens if we use/install 2.3 build in 2.2 device

I am working on application which should go into android 2.2(Froyo) and android 2.3(GingerBread) devices.
I have built application with android 2.3 SDK , and Installed the same application in 2.2(Froyo) and 2.3 (Ginger Bread) devices.
In both the devices application installed successfully and it is working properly.
I want to know if we install the higher version build into lower version devices is there any chances to face problems.
Till now I didn't found any issue with this.
I didn't used the MIN:SDK version field in the Manifest file.
If you want only users from version 2.2 and up to download your app, just make sure your minimum SDK version is 2.2 by putting this line in your AndroidManifest.xml:
<uses-sdk android:minSdkVersion="8" />
If you want an upper bound limit as well, you can add:
android:maxSdkVersion="10"
So users with Android SDK version 2.2 up to 2.3.3 will be able to install your app.
Regarding problems: If you're using a specific SDK API then just make sure to add an if clause around it to make sure you're on the right version. The best thing to do is change the target to 2.2 just to see if you have any compilation errors... Then you'd know what to change.
Then just fix the problems, change back to 2.3 and build.
If you don't specify the minimum sdk attribute in the manifest file users with 2.2 won't see your application on the market. It specifies that your application supports 2.2 so that users can see the app on the market.
Make sure any functionality that you use from 2.3 has an alternative functionality so that 2.2 users have the ability to actually use your application.
yes , u can find problem ,
try to install that app on android 1.6
it's about API version , there will be some APIs in your app doesn't supported in a lower API version

Categories

Resources