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).
Related
I have a file Sharing app on the Play Store. The app can transfer selected apps and .OBB files associated with them. I am testing my app for android 11 but am unable to get obb files for apps even with ALL_FILES_ACCESS.
The android documentation states the following:-
Write access to all internal storage directoriesâ , except for /Android/data/, /sdcard/Android, and most subdirectories of /sdcard/Android. This write access includes file path access.
Apps that are granted this permission still cannot access the app-specific directories that belong to other apps because these directories appear as subdirectories of Android/data/ on a storage volume.
So, in theory, I should have been able to read any file except for /Android/data directory and write to any directory outside of /Android directory except for /Android/media.
Please correct me if I am wrong. If, access to obb is not possible this way, is there any other way or is my app's feature just ruined and user cannot transfer obb files at all?
If your app holds REQUEST_INSTALL_PACKAGES permission it can access Android/obb directory.
Yes there is a fix
In Play Store download Google Files.
If already installed.
Hold the app and goto app info,
In last allow both "modify system" And "install unknown app" and you can easily copy and move from and to obb and data folder from Google files.
Sorry for my bad English but I hope u can understand.
You just need to enable "install unknown apps" permission for any file manager app AFAIK, and you will have access. Worked on my Samsung device with Samsung my files app.
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.
After installed, where can I find the files used by my app?
For example, my app use a sqlite plugin and it generate a database file, "dummy.db". I need to have access to this file but I don't know where it is.
If you run your app on emulator, you may open the emulator via Android Device Monitor and find your app's database using the path 'data/data/your_app_package_name/databases'.
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";
Hi i'm new to android my client want to run the app in their on Android Device i go through the many answers through Stack overflow like this:-
How to make .apk file
How to build an APK file in Eclipse?
but i'm unable to make build.
I want to make a build of app in which is usually .apk extension and how i'm able to install this .apk file in my clients android device it doesn't have any eclipse or IDE.
Please suggest me the way or some links regarding this process to build and install the app in clients android device without using eclipse or any IDE.
Thanks in advance.
Eclipse create .apk file of your project by itself and save it in bin folder copy that apk file and send that to client and tell him to save apk on SD card and run directly from SD card. It will work.
the moment you run the app on the emulator or a device, the .apk file is created and put in /%YOUR PROJECT%/bin/app.apk
you can send that to your client...