Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,768,635 Members 53,017 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Making app compatible with older Android version?

Tip us?
 
petegw42
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 2
Join Date: Mar 2014
Default [Q] Making app compatible with older Android version?

I'm new to the forums and a novice programmer but here's my question:

There's an app I'd like to run on my device for work. Per the play store, the app requires Android 2.3.3 and I'm running 2.2.2. I'm running the most recent version of a custom ROM on an outdated device so can't update my device's build.

I'm wondering if it's possible to tweak the app's source code and repackage it to make it run on my device. I have downloaded the .apk file and tried to install it on my phone and get a parsing error. So with the help of google I have managed to get into the source code using dex2jar and jd-gui. Problem is I don't know much about how apks are written. I found something in the 'accessibilityservice' area that seems to check the android build version, but as far as I can tell that is checking for whether the device is running ICS (if build >= 14) whereas the app is said to be compatible with older builds as well.

Anyway - how complicated would it be to port an app backwards so that I could run it on my phone? You should assume that I'm already in over my head.

Thanks.
 
Moonbloom
Old
#2  
Senior Member
Thanks Meter 97
Posts: 442
Join Date: Aug 2011
Quote:
Originally Posted by petegw42 View Post
I'm new to the forums and a novice programmer but here's my question:

There's an app I'd like to run on my device for work. Per the play store, the app requires Android 2.3.3 and I'm running 2.2.2. I'm running the most recent version of a custom ROM on an outdated device so can't update my device's build.

I'm wondering if it's possible to tweak the app's source code and repackage it to make it run on my device. I have downloaded the .apk file and tried to install it on my phone and get a parsing error. So with the help of google I have managed to get into the source code using dex2jar and jd-gui. Problem is I don't know much about how apks are written. I found something in the 'accessibilityservice' area that seems to check the android build version, but as far as I can tell that is checking for whether the device is running ICS (if build >= 14) whereas the app is said to be compatible with older builds as well.

Anyway - how complicated would it be to port an app backwards so that I could run it on my phone? You should assume that I'm already in over my head.

Thanks.
A LOT of things changed from pre-2.3 to 2.3 in Android, code-wise. It was a huge upgrade, and a lot of unsupported things were implemented.
It's set to run on 2.3.3 simply because it uses functions that only exist in 2.3.3 and higher.

So to backport it you'd need to get the source code, check what functions require 2.3.3 or higher, edit them to use other functions/write the code yourself. You can't just simply remove the code that checks what version of Android you're running. That won't do a damn thing.
The last part is the near impossible one, because you'd most likely have to write code that goes deep into the Android framework.

If i were you, i'd simply look for another app that can do what you need and doesn't require 2.3.3 or higher. Though there aren't many out there. Most people base their app on 2.3.3 because like 95% or higher use that version (or a higher one).

If you were to dive into this, you'd need extensive knowledge of Android, Java & backporting.
Though i'm not able to help with that, at least the backporting part.
Please click the "Thanks" button if I helped you

If you really want to thank me, or just need a Dropbox account, use my referral link by clicking on the image below and we both get 500 MB more space when you install the program, completely free!
The Following User Says Thank You to Moonbloom For This Useful Post: [ Click to Expand ]
 
petegw42
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 2
Join Date: Mar 2014
Quote:
Originally Posted by Moonbloom View Post
A LOT of things changed from pre-2.3 to 2.3 in Android, code-wise. It was a huge upgrade, and a lot of unsupported things were implemented.
It's set to run on 2.3.3 simply because it uses functions that only exist in 2.3.3 and higher.

So to backport it you'd need to get the source code, check what functions require 2.3.3 or higher, edit them to use other functions/write the code yourself. You can't just simply remove the code that checks what version of Android you're running. That won't do a damn thing.
The last part is the near impossible one, because you'd most likely have to write code that goes deep into the Android framework.

If i were you, i'd simply look for another app that can do what you need and doesn't require 2.3.3 or higher. Though there aren't many out there. Most people base their app on 2.3.3 because like 95% or higher use that version (or a higher one).

If you were to dive into this, you'd need extensive knowledge of Android, Java & backporting.
Though i'm not able to help with that, at least the backporting part.
Thanks for the very helpful information. I will definitely not be attempting this.

Most likely will be getting a newer phone in a few months when I'm due for an upgrade so it'll be a moot point. Until then, I'll get by.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes