RE:Crosswalk - Enabling the Android Move To SD Card Feature

So since the Ionic team did the excellent job of automating the integration of Crosswalk in (ionic/cordova) android apps, have been playing with the tool. The size of the built apk was the first deal-breaker for me, being able to make separate Arm and X86 builds helped a little but the size of the installed app still worries me.

I considered enabling apps to run from SD cards via the Move To SD Card feature in android and that was a breeze to achieve. Moving apps to the SD card sure helps to ameliorate the effect of the app size on the phone memory and performance. What Iā€™d like to table for discussion here are the pitfalls of doing or allowing this on the app? What do you guys think about this?

By the way, to enable the feature edit the AndroidManifest.xml file of the application to add an entry for ā€œandroid:installLocationā€ to the ā€˜manifestā€™ tag - set the value to ā€˜autoā€™.

Let me know what you all think.

1 Like

Nice! Thanks for sharing. Based on your post I figured it would be cumbersome and even some sort of bad practise to go ahead and manually edit the AndroidManifest.xml after creating it (I like my build process to be automated ;-)).

Therefore I went ahead and searched around the web for a cleaner Cordova-based solution and tried some different options myself. Unfortunately, there is no clean solution out there yet. But there is a (very recent) pull request on the cordova-android project adding this feature.

You can keep track of it here:

https://issues.apache.org/jira/browse/CB-5920

Letā€™s hope they implement it soon.

-Robin

Thanks for the follow-up @Robin. Hopefully the pull request gets pulled in soon. I have the feeling there used to be a tag to set it in config.xml pre-CLI days!

How did you manage to create the separate builds?

So @techntrails, the CLI has since been updated, see here for how to proceed now: Crosswalk Integration Beta in Ionic CLI (v1.3.2)

1 Like

hi i am shrikant thanx for this tutorial, i write android:installLocation=ā€œautoā€ in AndroidManifest.xml but after ionic build android it remove automatically and i cant move my app in external storage what i do help me

Did you find a solution? I have the same problem.

hi i follow this process but after build AndroidManifest.xml automatically rewrite by ionic and my ionic app canā€™t move on sd-card

Try this in config.xml:

<preference name="android-installLocation" value="auto" />

The Value may be: internalOnly|auto|preferExternal
as in http://developer.android.com/guide/topics/data/install-location.html

You may need this:

2 Likes

Hey @rafaellop, that plugin works great !

First add cordova plugin, then edit project_root/config.xml, thatā€™s it !

cordova plugin add cordova-custom-config //then add this line in config.xml// <preference name="android-manifest/@android:installLocation" value="auto" />

I added above just in case anybody got confused with too many docs readingā€¦

3 Likes