Android :: How Are PNG Files Defined As Drawable Objects Resized Based On The Resolution
Oct 8, 2010
I have a PNG file that is 32x32 pixels. I use 8 of these as drawables in a row for my app. These drawables are not in the hdpi, mdpi, or ldpi folders. I've found that when starting any of the 3 standard size emulators, the screen view with all 8 drawables looks pretty much the same.
I note that the ldpi emulator I'm using (QVGA) has a resolution of 240x320. 8 x 32 = 256, so since I can see all my drawables (and space in-between) I'm betting something is changing their size.
I've read the Supporting Multiple Screens document at the Android developers page, but I still don't understand what is actually happening. Could you put your own words to explain what is happening to the size of my drawables and how the SDK knows to automatically modify them?
View 1 Replies
Aug 10, 2010
I am working on an application where I am saving the state of an application in an ArrayList. Now, to save this state, I tried to use Serialization. But, somewhere in the user defined object, I am using Button, which is not letting me serialize the entire object. I wanted to know, is there any other way of saving this array list between onPause and onResume? I even tried onSaveInstanceState, but it doesn't have support for Array List.
View 1 Replies
View Related
Jun 9, 2010
I have to dynamically add a list of views (the views use RelativeLayout). Can I do this by specifying the view definition in xml and instantiate multiple objects off it? This gives the usual benefits of separating the view part from the code (for e.g., making it easy for the UI guys to alter things) or Is going the ArrayAdapter the suggested/only route?
View 1 Replies
View Related
Jul 30, 2010
I am presently using the following piece of code to load in images as drawable objects form a URL.
Drawable drawable_from_url(String url, String src_name) throws java.net.MalformedURLException, java.io.IOException { return Drawable.createFromStream(((java.io.InputStream)new java.net.URL(url).getContent()), src_name); }
This code works exactly as wanted, but there appears to be compatibility problems with it. In version 1.5, it throws a FileNotFoundException when I give it a URL. In 2.2, given the exact same URL, it works fine. The following URL is an sample input I am giving this function.
http://bks6.books.google.com/books?id=aH7BPTrwNXUC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U2aQRnAX2o2ny2xFC1GmVn22almpg
How would I load in images in a way that is compatible across the board from a URL?
View 2 Replies
View Related
Sep 8, 2010
implicit intent with class name as action defined in intentfilter. is not working. Only it it is defined as "android.intent.action." it is picked up ? is it so ?
I have app A with the following in manifest.xml file
CODE:.............
In app B, i tried to call the activity in A using below code.
CODE:.............
This code works. But not above line.
View 2 Replies
View Related
Aug 29, 2009
I'm making use of an API on the internet that is marshalling objects to XML files. Given that the XSD files are also available I'd like to be able to unmarshall them back in to Java objects once I've downloaded the files.After looking around it looks like JAXB is the default library for doing this in Java, but as I'm developing a mobile app the extra 8.6MB dependency just isn't acceptable. I also found XStream, but it still weighs in at 7.9MB.Poking around the Android SDK it looks like the only real XML parser available is SAX.
View 6 Replies
View Related
Oct 16, 2010
I've seen references to folks modifying the XML files contained inside the Android.jar.res.drawable folder and then copying them to their drawable folder for use in their project.
But I can't open these files, instead I get the following error.
Could not open the editor: org.eclipse.ui.PartInitException: Editor could not be initialized.
How do I open these files so I can use them?
View 2 Replies
View Related
Oct 26, 2010
The FAQ mentions a method of passing objects around activities. (It is not clear to me): "A HashMap of WeakReferences to Objects. You can also use a HashMap of WeakReferences to Objects with Long keys. When an activity wants to pass an object to another activity, it simply puts the object in the map and sends the key (which is a unique Long based on a counter or time stamp) to the recipient activity via intent extras. The recipient activity retrieves the object using this key.".................
View 7 Replies
View Related
Feb 11, 2010
I have to make a dedicated image viewer app for Android 2.x.
There are too many jpeg image files: about 2000~ jpegs, over 100MB.
I want access the image files with their file names,
but I couldn't find such an example.
By the way, is it okay to put many image files in /res/drawable folder?
I heard that the android application cannot be installed on sdcard and
the program repository is very small so 100MB app cannot be installed generally.
I found some examples which download the large data files on sdcard online,
but I cannot run a web server to host the data files,
and I must upload the fully packaged program on Android Market. (Should I build one apk file?)
What are the best practices for managing too many resource images (or something) in Android?
View 4 Replies
View Related
Jun 15, 2010
I have an application that have a Google map on Google Android 1.5 since we have been working on the application for a long time, we are not in stage of upgrading to the newest framework, so we are using 1.5. Now, I have map locations that are dynamically generated and drawn on the map at run-time to visualize some streams, Up to this point the application is working fine, Now my problem is that I am trying to filter the objects ( addresses) to visualize only the on-screen ones. I do NOT want to visualize the addresses that are off-screen. The way I am trying to do this is to check the screen-coordinates of each object (address) before visualizing it, then it the coordinates (x,y) more than (0,0) and less than (320, 460). I should visualize it. I am trying to use this approach, but it is not working for some reasons, I have tried many posts but could not understand why, there must be something missing somewhere that I am not aware of.
View 11 Replies
View Related
May 28, 2010
Can I have sub-folders to hold my drawable resources. For example can I store an image in, say, 'res/drawable/content/images/myimage.jpg' and then find that resource via a call to:
id = context.getResources().getIdentifier("com.mycompany.myprog:drawable/ content/images/myimage", null, null);
I have tried this and it doesn't seem to be working (but I may have something wrong). Is it supposed to work or do all the resources need to be in the root drawable folder? Also, are jpeg files supported and drawable resources?
View 5 Replies
View Related
Oct 16, 2009
How we can store image files(*.png) to the folder R.drawable at runtime?
View 2 Replies
View Related
Jan 14, 2010
What movie files are supported on the droid? I have tried to grab my digital copies of movies from itunes and add them to my droid but they will not play. I read some stuff about the crackberry site with movies, but they seemed to have low res, id like to get some higher res movies that look super sharp on the droid. how to get max res movies made for droids resolution.
View 8 Replies
View Related
Oct 19, 2010
I am running my application in the emulator using a high density skin (like WVGA800). However the ressources in my application are loaded from the drawable- mdpi folder instead of drawable-hdpi ... what else should I do so that android use the correct folder ?
View 4 Replies
View Related
Nov 18, 2012
I am having some difficulties with customizing my rk2918 based tablet. I managed to download the original firmware and it is in .img format. Now I have managed to take apart the single .img file into multiple .img files, customized and rooted it with dsixda's kitchen and rebuild the ROM. Now my question is, can I somehow convert the zipped package back into the multiple .img files, or even into the single .img file so I can flash it with RKupdate or RKbatchtool? How to extract image files......
View 2 Replies
View Related
Oct 4, 2010
How can I tell android to not crop my layout when displaying the on-screen keyboard but to instead resize it?
View 1 Replies
View Related
Jun 26, 2010
I have a program that should work on Android 1.5, but when it's run on newer devices with higher resolution screens, it should support the full resolution and not emulate a lower resolution screen. As far as I can tell from the documentation, this should be simple.
I just specify
code:.........
The problem is that if I tell Eclipse to compile for 1.5, it refuses to accept this. It reports an error (targetSdkVersion is an unknown tag) and refuses to compile or run. If I tell it to compile for 1.6 it works fine, of course. But if I then try to install on a 1.5 AVD, the program immediately crashes with a java.lang.VerifyError. I'm clearly missing something simple. How do I get it to compile an apk that works under 1.5, but still includes the targetSdkVersion tag?
View 3 Replies
View Related
Apr 14, 2010
I'm in the middle of developing a new soft keyboard. But I got trouble. When I input some text, my soft keyboard pops up and the background is resized, which is not an option I want. I'd like to force the background to keep its current state even though the keyboard pops up.
View 2 Replies
View Related
Aug 26, 2010
When I email a photo from the desire, the receiving end photo is huge. Anyway to resize for emailing as can be done from a PC.
View 5 Replies
View Related
Jan 27, 2010
For some reason, all of my incoming picture messages are being resized to 3kb. It never used to do this; it started when I installed Handcent. But even after uninstalling Handcent, I still receive tiny pictures. It's driving me insane. Anyone know anything about this?
View 9 Replies
View Related
Feb 1, 2014
I was wondering if it'd be possible for someone to change the default size of the Google keep widget. I know that you can do so in your launcher but Aviate doesn't let you change the size and it's ridiculously tiny.
View 2 Replies
View Related
Apr 8, 2013
How do I convert phone resolution Bootanimation to tablet resolution?
I have 4 boot animations that I want to convert to work on my Nexus 10 full screen.
Also, how to be able to edit [URL] to show 10 instead of 4 or completly remove the number so it works nicely on both my Nexus 4 and Nexus 10.
View 1 Replies
View Related
Mar 5, 2010
I'm still new to Sprint.. I used to be a Verizon guy for 8 years. And I'm used to send and receive pictures with the original resolution they were taken. But I've notice that Everytime I get a Pic msg with my moment they're ridiculously resized. Same thing happens if I send one they get a crappy sized pic.
Is there a way around it?
Is it sprint?
Or is it Android?
View 6 Replies
View Related
Jun 30, 2010
Where can I see what typeface, size, color, etc. are used for Android's pre-defined text styles? Like the default text style or textAppearanceMedium, for example?
View 3 Replies
View Related
May 4, 2010
How do you get the default value of an Android preference defined in XML?
Context: I don't want to repeat the definition of the default value in both the code and the preferences XML.
View 1 Replies
View Related
Oct 18, 2010
I have a ListView that I want to populate with objects whose layout is defined via XML. Is there a way to instantiate a layout at runtime, editing stuff like the Android layout ID, etc., and then load the new layout into the list?
View 5 Replies
View Related
Apr 25, 2010
I have two apps, one runs in namespace com.gtosoft.voyager and the other is com.gtosoft.dash. From com.gtosoft.dash I would like to start up the service which is defined in com.gtosoft.voyager...
I think I need an intent, but what arg(s) would I pass to the intent before kicking it off with startService()?
If they were in the same package I could just use
CODE:............................
View 1 Replies
View Related
Aug 28, 2009
Where is the right place to specify general user-defined properties, like a host address or a service mail address ? The properties should be accessible from my activities.
I would like to specify such attributes within the AndroidManifest.xml, but there seems to be no elements available for user-defined properties. So the only way may be to put such properties into a resource file as strings or to hide them into the source code...
View 2 Replies
View Related
Sep 20, 2010
I would like to use self defined Environment variables in my source code.
I use System.getenv() to do this and the code line looks like this. Log.d("MyTest","== MyEnv " + System.getenv("AP") + " ANDROID_ASSETS:" + System.getenv("ANDROID_ASSETS"));
Before I execute my code I define my AP variable with export: export AP="12345" and the this is my output of set command
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=9,32768
ANDROID_ROOT=/system
AP=12345
Then I execute my code and I get this line from logcat
D/MyTest( 5363): == MyEnv null ANDROID_ASSETS:/system/app
The value for my defined Environment variable is null. Any suggestions on why it didn't work?
View 1 Replies
View Related
Sep 24, 2010
In my android application that is now working fine, I am sending custom SMS from a user to other one.
Once I detect the SMS come from my application, I do my stuff with the message and everything work fine.
But now, I do not want the SMS application to detect this message as it is totally useless for the user.
So what I would like to do:
As soon I receive it, I get the text and avoid the system to get it ( or at least stop the notification for this message)
Any Idea on how to do? code....
View 1 Replies
View Related