Android :: Delete Assets At Runtime

Jun 25, 2009

I have a large (900kb) asset in the assets directory which is only used once by the app at initialization time. Is there way for me to delete this file at runtime? If not delete change it's contents to "0" and effectively reduce its size to almost nothing. There isn't really any point of having this take space on the phone's limited memory.

Android :: Delete assets at runtime


Android :: Runtime Error Using Exported - Signed Apk But No Runtime Error Using Eclipse IDE

Mar 2, 2009

1) I am developing my app in Eclipse 3.4.1 with Android (ver 1.1_r1) plugin. My app compiles and executes without errors when using the Eclipse IDE.

However, when I export my app (unsigned) using Eclipse (via {select project} >right-click>Android tools>export unsigned application package), sign it, and try to run it on the Emulator, it throws a runtime error when I try to update my sqlite database, at which time the specific error created is: SQLite error#14, unable to open database. It is able to read from the database without problems. (I have also verified that the database is: open, is not readonly, is not locked by another thread, is not in the middle of a transaction.)

I have limited experience, but this seems more like a "system" problem given that the app works OK in Eclipse IDE but then fails as an exported/signed apk. Some googling of SQLite resources revealed a similar error on a non-Android platform which was fixed by: "Set your permissions correctly on /var/tmp, or whatever directory you are using to hold temporary files".

Does Android have temporary files, and if so how does it handle permissions on temporary files? Is there a way to check or set these permissions to see if this fixes my problem here?

2) Not sure if it is related, but after I have run the exported/signed app which causes the runtime error, if I reboot the Emulator, and try to run the program using the Eclipse IDE , the program fails with the same exact error. PLUS I also noticed the following error message while the program is installing/running: 03-01 22:22:29.282: ERROR/PackageManager(53): Package com.northwestradiology has mismatched uid: 0 on disk, 10019 in settings; read messages:

I can restore the Eclipse version of my program to be able to execute without runtime errors by utilizing the -wipe-data option for the emulator. But note that if I run my signed APK using an emulator created with the -wipe-data option, it still throws the runtime error listed above...

View 2 Replies View Related

Android :: Assets No Value Read

Jun 14, 2010

CODE:..............

In this case 'i' is -1 meaning nothing read. Why would nothing be there if the file is there, the variable 'files' has the file as well. Do I need to do anything to the file I put into the Assets folder in get it to be readable? When I use a small text file it works. When I use a 10 meg file, it does not. (The 10 meg is a Sqlite database I need to install)

View 2 Replies View Related

Android :: Assets From App To Sdcard

Aug 20, 2009

As my app is too big in size and it seems a long job downloading resources from web server. i want to move my files from assets folder in the app to sdcard on first run. is this possible?

View 2 Replies View Related

Android :: Accessing Assets That Are Larger Than 1M

Oct 6, 2009

It has come to my attention that Android can only deal with asset files that are around 1M or so. My problem is that i'm creating an app that requires access to 5 csv files. The largest of the files is 130M. I want to be able to package these text files with my app. Is there anyway around this? My app needs to be able to run without Internet access so storing these files on a server is not an option.

View 10 Replies View Related

Android :: Xml Pull Parser Assets Xml

May 23, 2010

How can i parse a local xml file in the assets folder using pull parser. cant get pull parser to work, always throws io exception. i think i cant get the path to the file, or connecting to the file.

View 1 Replies View Related

Android :: Security Assets Folder

Aug 4, 2010

Is the assets folder only accessible to the app or can the user see it too? For my app I want to store a credential certificate and video files on local storage but I am not sure how to hide these items from the users. The assets folder seems like the only choice.

View 1 Replies View Related

Android :: Localizing The Assets Folder

May 11, 2009

The instructions for my app are in HTML format in my assets so I can display them with proper formatting and hyperlinks in a WebView. Given that they're in the assets folder, not res, I can't properly localize them (i.e. something like assets-de wouldn't work). What's the proper way to localize embedded HTML files?

View 2 Replies View Related

Android :: Install APK From Assets Or RAW Folder

Aug 6, 2010

I would like to install an APK from within an Android application. Can anyone give me an example of how to do this? Also how do I open the install applications from unknown resources preference page so that users can change it? I actually meant open the screen using code, so I can immediately open the preference page for the user to simply check the box, and press back. Is it possible to check to see if they allow non-market apps? Can an application request permission enough to do this?

View 1 Replies View Related

Android :: Get List Of All Resources / Assets In APK?

Aug 11, 2010

I am trying to get list of all raw resources or assets packaged in my APK. This is required because i have written code and i am generating APK's after changing only resources. So, I want to know how many resources exists in my APK.

But i am not able to find any API from which I can get the list of resources which are packaged in my APK.

View 2 Replies View Related

Android :: Loading JS / CSS Files In Assets Within HTML

Jul 8, 2010

I'm loading html into a webview from my assets folder, works no problem. In my second experiment I've loaded HTML from a database (after pulling from remote source) and displayed in a webview (also no prob). Now I'm trying to change the baseref inside the html to have all JS and CSS references point to source files under assets. This part doesn't seem to work. I get warnings from the web console that it can't load these files due to security issue.

Now I've resorted back to a content provider and overriding openFile (and setting base ref with content://...) but now I'm hitting another problem with the JS and CSS files in assets being compressed. Can load html from assets but loading JS, CSS from within that HTML is another story. Before I dig deeper, am I over-complicating this?

View 3 Replies View Related

Android :: What Is Absolute Path Of Assets Folder?

Nov 9, 2010

What is the absolute path of the assets folder? I need it to reference some images saved in this folder from a html file saved in the memory device.

View 1 Replies View Related

Android :: Absolute Path Of Assets Folder

Nov 11, 2010

How do I reference the assets from phone memory? I need it to write the absolute path into a html file to load some images which are in assets folderThis html is saved in the phone memory but I can't to save these images in the memory phone because these are very big.

View 1 Replies View Related

Android :: Downloading Game Assets To SD Card

Apr 23, 2010

I'm developing an Android game that has to download some assets to the SD card to keep the size of the app as small as possible. I was thinking of using an uncompressed zip file to bundle all the assets.

A requirement from the client is to protect these assets as much as possible. Being part of the apk is considered enough protection, but if I do this the apk size will be enormous. If I just put a zip bundle in the SD card, then anyone can unzip it and explore its contents.

Is there a simple way to do this without retorting to horrid DRM?

View 1 Replies View Related

Android :: Playing Sounds From Assets Folder

Nov 9, 2010

I have 5 mp3 files stored on the assets folder. The files are all 25 KB. I load the files using:
manager = context.getAssets();
this.inputStream = manager.openFd(fileName).createInputStream();
Whenever I try to play the files, the sounds are all messed up like they were mixed or something.
I've zip aligned the app already but with no results.

View 3 Replies View Related

Android :: Way To Load WebView Assets Correctly?

Nov 17, 2009

I have a WebView that I'm using to display some html/image files stored in the assets/ directory.

View 10 Replies View Related

Android :: Any Way To Put Entire Folder From Assets To SD Card?

Oct 8, 2009

What I am trying to do is simply copy over entire folder full of mp3 files onto sdcard within an app. I am doing this out of "assets" folder because raw folder does not allow mp3 files to be named the way I need them to. Here is what I dug up so far but not sure if this will work. I am lost.

InputStream ins = getResources().getAssets().open(""); int size = ins.available();
// Read the entire resource into a local byte buffer. byte[] buffer = new byte[size];
ins.read(buffer); ins.close(); FileOutputStream fos = new FileOutputStream("/sdcard/myfolder/");
fos.write(buffer); fos.close();

View 4 Replies View Related

Android :: How To Set Widgets Font In Assets Folder?

Aug 20, 2010

I want to change the font in my widget such that it uses a specific font in "assets" folder of my app. I usually do this in my app to change the font:
Typeface tf= Typeface.createFromAsset(getAssets(), "advertising.ttf");
TextView converted = (TextView)findViewById(R.id.TextView03);
converted.setTypeFace(tf);

And it works like a charm. How can I do this in widgets? I can only set the text and change the color:
remoteView.setTextViewText(R.id.TextView03,"some text" );
remoteView.setTextColor(R.id.TextView03, Color.BLACK);
But I don't see a way to set the font.

View 1 Replies View Related

Android :: Binding Images From Assets To A SimpleCursorAdapter

Nov 23, 2009

I was poking around in the documentation for the simpleCursorAdapter and I read that if the simpleCursorAdapter doesn't identify your images as resources it will assume they are URIs. My question is how do i retrieve the URI for an image placed into the asset folder of my application?

View 8 Replies View Related

Android :: Images From Assets Folder In GridView

May 2, 2010

I have been working on creating a Grid View of images, with images being present in the Assets folder. http://stackoverflow.com/questions/1933015/opening-an-image-file-inside-the-assets-folder link helped me with using the bitmap to read it.My application does read the image from the Assets folder, but it is not iterating through the cells in the grid view. All the cells of the grid view have a same image picked from the set of images. Can anyone tell me how to iterate through the cells and still have different images?

View 2 Replies View Related

Android :: Unit Testing With Test Only Assets

Jul 3, 2009

I my main app and tests are organized like this (standard from "android create project"): AndroidManifest.xml assets/ main app asset files src/tests/AndroidManifest.xml -- uses <instrumentation> to point to the main app assets/ -- test-specific asset files src/ Writing test cases with AndroidTestCase, I'd like to load asset files from the test-specific assets/ directory, not from the main app assets/ directory. How can I accomplish that? The normal way to load an asset would be getContext().getAssets().open ("foo.txt"), for assets/foo.txt in the main app. I assume I just have to somehow change the Context or the AssetManager to point to the test- specific assets directory, but I don't see any way to do that. I have looked into the tests/bin/MyApp-debug.apk to confirm that the test assets are in there. Now I just need a way to access them.

View 2 Replies View Related

Android :: Writing To File Assets Folder

Nov 16, 2009

Can any one give the code to read and write to a file in the Android assets folder.

View 3 Replies View Related

Android :: Designate An Arbitrary Folder As Assets

Jun 22, 2010

It seems that the Android resource compiler does not take into account linked folders (in Eclipse sense) in the assets folder. Question - is there a way to forcibly designate a folder of my choice as Android project assets? Short of copying or hardlinking into project assets, I mean.

View 1 Replies View Related

Android :: Play Mp4 Video From Assets Folder

Aug 21, 2010

I want to play mp4 video which is available in my assets/raw folder. I am successfully playing mp4 video from my sd card but not able to get video from assets folder or from raw folder.

View 1 Replies View Related

Android :: Play A Video From My Assets Or Raw Folder In App

Sep 19, 2010

I want to play a video from my assets or raw folder in my app in ANDROID using VideoView I am getting the error as video cannot be played.

Here is the code I used:

CODE:...................

View 1 Replies View Related

Android :: Filenotfound Exception From Assets Folder

Nov 1, 2010

While reading from file under Assets/sb/example/simple.html/It is giving filenotfound
exception.

CODE:...............

Code Snippet is:

CODE:...............

View 1 Replies View Related

Android :: Smaller APK Size With Large Assets?

Oct 5, 2010

I am creating a simple android app to view a comic book. The pages are large(0.5-1 mb each), high quality .png's and I am loading them into a webview to make use of the built in zoom controls. So far I only have 17 files and the APK size is already about 16 mb. I'm looking to add over 200 files in future updates. I can't really reduce the quality too much because there is small text that must be zoomed-in on to read. Any suggestions? A similar question was posted here: How to reduce App (.apk) Size, but I don't want to lose the quality of the images. I'm not sure if it's appropriate to link to here, but you can have a look at my app by searching for Tracer (by Detour Mobile) on the android market if it helps at all.

View 1 Replies View Related

Android :: Loading Video From Assets Folder

May 21, 2009

I'm trying to load a video file from assets folder, but MediaPlayer or VideoView still crashes. Somebody has an idea?

View 4 Replies View Related

Android :: PackageManager Component Info Error Getting Assets?

Aug 6, 2009

my application caches static resources in its /assets directory and implements a content provider to provide them to a WebView on request. i kinda have to drive around the houses a bit because it seems i can't get a linear file descriptor on an asset, i get "this resource is zipped" or somesuch, don't know why that's a problem. the content provider just caches the asset in /sdcard and then returns a file descriptor off that. this has been mostly working fine, but i've started seeing errors from the PackageManager. nothing's changed on my end, the assets are still there, etc. the actual error i'm getting is -ndroid.content.pm.PackageManager$NameNotFoundException: ComponentInfo{package/activity} (where "package" is the name of the package, etc) can i get anything wrong with this stuff? caching javascript and css stuff in the apk has been a big performance win.

View 6 Replies View Related

Android :: Error Creating MediaPlayer With Uri Or File In Assets

Jun 22, 2010

I copied song.mp3 to my project's assets directory and wrote this code:

private MediaPlayer mp;

Uri uri = Uri.parse("file:///android_asset/song.mp3");

mp=MediaPlayer.create(this, uri);

After running the create statement, the variable mp is null.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved