Android React-Native, how to update index.android.bundle file at runtime? - android

I am building an android application which has combined functionalities of Native(Android-Kotlin) and React-Native.
We have a requirement to update index.android.bundle file at runtime after the user installed an application. How can I achieve this requirement?
I am having the following queries on the same.
Can I place index.android.bundle file outside of assets folder in android?
Where can I place Fonts and Drawable assets which are used by react-native functionality?
Requirement is:
After the user installing an application. If we have any updates in react-native functionality without re-publishing an application in play-store, we have to download and update the index.android.bundle file in the assets folder.
As per Android restrictions, we cannot add or change any file in assets folder at run-time/dynamically.

Related

How to integrate react-native assets with Flavor/Target?

Is there a way to build several versions of the same application. The only information that differs is the name of the application, the package and a folder with auduo files embedded in the app?
I use react-native.
Build 8 apks with the same code but different name, package name and audio assets.

Unity support for an app Split

I just built an app for Android using Unity3D. The app weighs 200mb. During testing I used to build a single apk which always worked. Now that I uploaded it on PlayStore, I had to use Unity's built in split feature which creates an apk and an obb file.
My problem is that now the app isn't working. It seems like the obb file isn't being loaded properly and the app doesn't find the files.
I have some assets in StreamingAssets folder which are loaded dynamically and the app doesn't seem to be able to find these along with the other scenes.
What I did to try to fix this with no success:
Added READ_EXTERNAL_STORAGE permissions
Added WRITE_EXTERNAL_STORAGE permissions
Added a plugin to force permissions dialog Unity Android Permissions
Set to false unityplayer.SkipPermissionsDialog in the android manifest
Added GooglePlayObbDownloader in my project but it seems to crash the app because of the missing License. (I can't retrieve the license)
What am I doing wrong?
I had a working app, then I enabled Split Application Binary in Player Settings > Publishing Settings and it stopped working. Disabling the feature, the app works but can't upload it on Google Play as it has a 100MB file limit.
You mentioned using UniWebView. The documentation recommends placing your web files in the Assets/Plugins/Android/assets/ folder.
If you are using "Split Application Binary" for Android build (obb files), you should not put your local HTML files under StreamingAssets folder. Instead, you need to put them to Assets/Plugins/Android/assets/ and then you can use the same way as you did for normal streaming assets resource to load it from the new location.
https://docs.uniwebview.com/guide/loading-local-files.html#using-split-application-binary.
Unfortunately this will simply move the files from the .obb to the .apk file, which might push you over the 100mb limit again.

Cordova - How to hide asset folder in .apk?

I change my .apk file to .zip and open it on WinRAR. The problem is assets folder is showing so my JS and HTML files are shown. I am using Cordova to develop my app.
How can I hide the assets from the .apk?
If you wouldn't have the assets on the .apk, how could they be in the device when you install the app? Of course those need to be available and as it says already on the security guide of Cordova:
Do not assume that your source code is secure
Since a Cordova application is built from HTML and JavaScript assets that get packaged in a native container, you should not consider your code to be secure. It is possible to reverse engineer a Cordova application.
After installing the app on the device, you are of course allowed to download the assets from online and even store them for offline usage with something like File plugin, but that is completely different case and maybe not even what you wish to do.
Cordova - How to hide asset folder in .apk
1)Encrypted all Cordova assets files.
2)Decrypt the files and move to the internal storage during runtime.
3)Access your assets files from internal storage( this.getFilesDir().getAbsolutePath()).
Following these things will keep your file and method calling safe as they are accessible only
to internal storage.
Replace launchUrl "android_asset" to "data/data/io.cordova.hellocordova/files/"
Example: modify the dev source.
1) "file:///android_asset/www/index.html"; to Replace
"file:///data/data/io.cordova.hellocordova/files/www/index.html";
2) "file:///android_asset/www/index.html"; to Replace
"file:///data/data/io.cordova.hellocordova/files/www/index.html";

Config file for Android App

I made an Android activity and deploy it to my device using eclipse. Now i would like to add a INI configuration file to it.
What would be the right place to install this file on the device ?
I want want this configuration file to be modifyable without having to open the project using eclipse so that someone without programming knowledge or developping tools could still be able to modify this config file.
Thank you :)
What would be the right place to install this file on the device ?
External storage. It is the only place the user has access to.
You might package a template or starter version of your configuration file inside your app, such as in assets/, then copy that file to external storage on first run of your app (or if the user accidentally deletes or corrupts the copy on external storage).

how to copy sqlite database when installing android application

I am using sqlite database in my application,i want to copy this sqlitedatabase file when creating apk file and paste on mobile during the installation of the application.Is there any packaging options to do this ?
Thanks in advance
Ragu, there is a broadcast that occurs when installing apps from the market place but since you are installing your app, the event obviously doesn't get received by your app.
Copy the database file to your assets folder and on the first invocation of the application, you might be able to copy the file from your asset folder into internal storage.

Categories

Resources