Here is the thing,
I want to download resources from the Internet and add them to my application.However, I have searched a lot and did not get a solution.So, Finally asking you guys, Please help!!!!
Findings:
I can load java code with dexClassLoader.
I can not not use APK extension file.
I dont want to access resources from another APK. Because then I need to ask user to install one more apk.
If I download resources just like an image file and try to use bitmap,Will it be too slow for my app.
Please do not say "NO its not possible".Will any hack do this???
I want to download resources from the Internet and add them to my application
You are certainly welcome to download files and use them. You cannot download resources as defined by the Android SDK, as those have to be compiled into the app.
I can load java code with dexClassLoader.
This has security ramifications. I do not recommend this.
If I download resources just like an image file and try to use bitmap,Will it be too slow for my app.
Many Android apps download images from the Internet.
Related
I want to download a pdf from a url on Android>=11. My app is targeting android version 30.
I read that due to restrictions introduced from Android 11, it does not easily allow us to store files in external Downloads folder and we have to store it inside Android/package_name/[folder]/[file], but I want to store it in Downloads folder so that my user does not have to go inside Android/package/[Downloads]/[file] to view that file.
Also on devices which are running Android<11, I can download that file by simply using getExternalStorageDirectory right? Please provide me some clarity on this.
I found some answers previously but they weren't that helpful. Can anybody tell me how to achieve this?
In Android 10ff it is not easy to use the java class "File" to store data in a public accessable folder that is pre-defined by your app.(ie the public download folder)
Instead your app has to ask the app-user where he/she wants to store the document.
I try to make Webview from to display application/x-shockwave-flash embed element in my app, but i have blank gray screen on emulator and white on device. There are many topics about this problem but any1 really solved.
I explore log of simillar app and see: file//android_asset/index.html. So question... this static file or i can get it from web or modify it.
I trying get my data video.loadDataWithBaseURL() from web, but can i have that data from local storage?
Maybe I said something wron but it's look for me like 'convert web data to local'?? Can some one help my in my problem or explain in this question.
Thank you.
file://android_asset/ is a way that allows android apps access assets by a network-based URI. But assets represent neither local nor online files, they are packed into your apk. Put any files in assets folder in a android project and they will be packed into the apk file by the builder.
I am writing an android application which has a lot of images in it.
I do not want to keep these images as a part of my apk file because that will make the size of the apk file very huge.
I have written the application in a way that it loads these images at runtime from the sdcard from some predefined location. Now my problem is that how do i provide these images to the user who wants to install my application. Since the images are not a part of the project (i.e. not present in any of the drawable folders) so they will not be a part of the APK file that i provide.
Is it even possible to do such a thing in Android? Or can someone suggest a better solution that i have right now. Any help is greatly appreciated.
There is an official way to achieve what you want: APK Expansion Files
I'm programming an application in android which uses OCR. I'm using the tesseract ocr and I want to ask where should I put the language files in my project, so that when I install my app in my phone(Samsung Galaxy S) the files be somewhere for the app to use them for the ocr process. I think that it should be in a place like: /mnt/sdcard/tesseract/tessdata, but how this can be done without putting them myself in my device and let the installation to do this.
You'll have to include the files with your project in the assets folder.
See AssetManager to learn how to access your files from your activity. Also I would suggest that you don't copy them to the SDCard. Unfortunately since your files are going to have to be included with your project, and thus will be present in your apk file you're going to end up with a larger application size. But also unfortunately I don't believe that there is a way to delete the files from your apk at runtime, so even if you copy them over to the SD your app is still going to be the same size. For that reason I see no reason to copy them to the SD card, just access them from the AssetManager when you need to get them. Doing it that way also means that your application will not break if the SD card is removed / unmounted.
Simply put them under Assets in a "tessdata" folder. That is in your project.
You can use Xamarin and the Tesseract for Xamarin nuget package, they're really easy to use, just bear in mind that you probably will have to install older version of the nugget if the latest version doesn't work. (2.10 was the working one as far as i remember)
I'm developing an Android application. I'm very new on Android development.
I see on other projects that textures are hold on res directory. They have to be compiled and deployed into device.
I'm wondering if I can download a picture as a texture from a web service and use it.
I don't know if every media that I need has to be compiled.
Thanks.
Yes you could download the pictures from the web and use them. If you plan on having changeable content then you should probably do so as well.
Adding Images to Res will have them included in the APK and, Then copied to the device on installation (Unless you use zipalign which should sometimes allow you to use content from the apk)