Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Making app compatible with older Android version?

OP petegw42

23rd March 2014, 05:04 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Mar 2014
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.
24th March 2014, 12:15 AM   |  #2  
Senior Member
Thanks Meter: 97
 
442 posts
Join Date:Joined: Aug 2011
More
Quote:
Originally Posted by petegw42

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.
The Following User Says Thank You to Moonbloom For This Useful Post: [ View ]
24th March 2014, 01:39 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Mar 2014
Quote:
Originally Posted by Moonbloom

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.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes