push an apk file into assets folder programmatically in android - java

Can i push an apk file into my assests folder programmatically?I wanted to use this apk file
in my application.
Please forward your valuable suggestions to me.
Thanks in advance...
Priya

AFAIK, you can't store it in the assets directory. However you can store is some where on the sdcard or cache directory. Check this for different data storage methods available.

Related

How can i make android application load its assets from external storage folder rather than its local assets folder builtin in apk?

Is there any way to load application assets from external storage ("DCIM") folder rather than its ("apk") builtin ("assets") folder. Please tell me how to do it?
I have given read write permissions too and I have tried giving path by
String pathToAssetFolder = "file://"+Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + "/assets/";
Please let me know how can i load these assets contents from external directory?

Delete database file from assets folder

I want to delete a file in assets folder in run-time. I have a database file in assets folder that copies to data folder at run-time but after installing my app the size of app become twice as large (assets + data folder)!
How I can delete database file from assets folder to avoid this?
You can't delete a file at runtime that was delivered with your App.
See this discussion about it:
How to remove a file in assets at run time?
The whole content of your APK is read only and can not be modified
in addition to the above answer, one thing you can do is preferExternalStorage in manifest..which will help

Copy file to assets folder

After searching 1 hour i do not found any solution to my problem.
I want to move a file from sdcard to assets folder and also overwrite the existing file in assets folder (both file are sqlite database have same name with just a little difference in data )
??
Actually, The behaviour of the android .apk file is read only so the directory structure which are in that apk file follows the same, So no one can write this files or make changes on that at runtime,that's why You can't make a changes in /asset folder at runtime. you can read file from it (means copy files which are available in asset to any internal storage or /sdcard but not write it to vice-versa)
Its apply on all the directories which are build in .apk files. As per docs.
Assets folder are not Writable it is only readable so you cant copy from sdcard to assets, yes you can copy from assets to sdcard
If you want other apps not to access your database then what you can do is
Download the database from website. create a temp database also in app directory.
getDatabasePath() this will give you the path of the dummy database you have created now replace this with the one you downloaded.
PS.: User and apps having root access still able to access it and you cant do anything in that scenario

Android access files backed up in device through DDMS

How to access the files that are backed-up in Device, through DDMS? Thanks in Advance...
Use "File Explorer". It is a part of DDMS View.
Using File Explorer you can View , Pull files from Device. Push files to Device and Delete files as well.

how to download folder containing files(pdf,png etc) from php server in android

i want to download folder containing files like pdf,jpg,png etc from web services.I have written a application that can download pdf,png file.But i want to download folder containing several files. So my question is- is it possible to download folder and if yes then how can i download folder from server in android. thank you
If you can download one file, why wouldn't you be able to download several? Create the folder on Android, queue the files and start the next download when the current is finished, filling the folder. Also Android supports ZIP, so that might be your best call.
Folder is nothing but an FILE but a different type of file. Once you get the folder you can list down the files in it. You already have URL with the folder, u just need to append the URL of the folder to the files in it and download them one by one.

Categories