Android Question change manifest programatically ?

marcick

Well-Known Member
Licensed User
Longtime User
Hi all,
due to the troubles working with SMS and Android 4.4 KitKat as discussed here

http://www.b4x.com/android/forum/th...sages-without-notification-android-4-4.37171/

now I'm arrived at this point: I would like my app behave in a "standard way" for Android version to 4.3 and "kitkat way" if a 4.4 device is detected launching the app.

Standard way means intercepting SMS with SMS interceptor as I did til now.
KitKat way means force my app to be the default SMS app and uses static receiver to intercept SMS.

Because "kitkat way" has some disatvantages as well discussed there, I don't want to definitely move my app to this method, but only for those user that have upgraded their devices to Kitkat.

But the two methods requires different content in the manifest, so I'm asking if it is possible to change manifest programatically if a 4.4 device is detected and switch to "KitKat way"
 

marcick

Well-Known Member
Licensed User
Longtime User
Erel, I need help to understand better. Probably I'm doing some confusion.

My goal is to do an update of my current app that continues working with SMS interceptor but, if KitKat is detected, change mode and uses static receiver and forces the app to be the default SMS apps.

So:
1) I create a blank project "SMS_KitKat" that include the static receiver, the three services and the manifest code to allow this app to appear in the list of the SMS app of the device. The TargetSdk in the manifest is 19 and the MinSdk is 11.
2) I compile the project as library.
3) I came back to my current app where the TargetSdk is 18 and MinSdk is 11.
4) I include the library "SMS_KitKat"

What happens now ? Will the library be considered (and the related manifest code) only if the device is kitkat ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Oh, now understood ...
So, there is no way to maintain a single project that is valid for 4.3 and 4.4
Thanks
Marco
 
Upvote 0
Top