Android :: Can A Drawable Accept A Ninepatch File Reference?
Mar 31, 2010This is specifically about android UI xml.
Can a drawable ie the ,/drawable> tags accept a reference to a ninpatch xml file?
This is specifically about android UI xml.
Can a drawable ie the ,/drawable> tags accept a reference to a ninpatch xml file?
I want to use the ninepatch image in the file system. but seems that it can be referenced via res.
how to get the auto-scale support for the images in file system.
I've created a class that extends drawable that I'd like to reference inside a resource xml.
I happen to need it in a selector, like so:
CODE:.................................
Is it possible to have subfolders in the /res/drawable directory. I would like my resources to be organized in a tree view and not in a flat dir. If it is possible so how do I reference the resource from the code?
How can I had to class layout in R another XML file? It should be automatic as I had new resources to res, but it's not. Someone knows what I did wrong? I open an activity and now I want to open another activity that will work with another XML example. I have menu and main.xml. Now I want to go for another activity called gamescreen using this method: Code...
View 5 Replies View RelatedAnother day, another Android feature missing it seems. Someone has just sent me a VCF file with their contact details. I can open it - it opens up as plain text which is not very useful. (a) How can I get this into my contacts? (b) Can I send my own VCF back?
View 5 Replies View RelatedI have a button that launches the google maps app on my device via an intent. I want to be able to pass it a php page that generates a KML file.
I have done this on a website before using the googlemaps api in JS - but it doesn't seem to work on Android.
My php file is as follows;
CODE:..............
Launching with:
CODE:.................
It launches maps, finds the file - but won't display it 'because it contains errors'.
Is this just not possible, or are there other ways to construct the intent that might work?
I am trying to get googlemaps to accept a local KML file.
final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=file://" + Environment.getExternalStorageDirectory() + "/locate.kml"));
startActivity(myIntent);
The file is on the SD card, and is a valid KML file. Google Maps loads up, but says it cannot find the file.
final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=http://www.website.com/locate.kml"));
startActivity(myIntent);
Works fine. geo: 0,0? q= seems to be very under documented, how to use it to refer to a local file?
I would like to get in my file browser File reference to external disk not SD Card. I mean I know that there is method
Environment.getExternalStorageDirectory();
But to my knowledge this will get reference to SD Card. But how to get external disk (say kind of USB storage attached to Android device)? You know that device can have both SD card and external USB stick attached to them.
Like the title. I have a small drawable file, but the ImageView is much larger than it. How I can fill it without left any extra space?
View 1 Replies View RelatedI'm using Eclipse 3.5.2 on win7 with latest sdk update. Every time i create ninepatch image and copy it into drawable folders, the project becomes error, seems that the file cause error and not supported. Any solutions?
View 4 Replies View RelatedI have some problems finding the documentation of the definitions of shapes in XML for Android. I would like to define a simple circle filled with a solid color in an XML File to include it into my layout files.
Sadly the Documentation on android.com does not cover the XML attributes of the Shape classes. I think I should use an ArcShape to draw a circle but there is no explanation on how to set the size, the color, or the angle needed to make a circle out of an Arc.
I have an image on a private file.
I read the file, create the drawable, and assign it to an ImageView.
The ImageView has WRAP_CONTENT so the size is automatic.
On 320x480 screens, the image looks good
But on screens with more resolution and high density 480x800 or 480x854 (N1, droid) , when the image is for example 150x150, I see the image as 100x100.
Of course it has something to do with the density but not sure how should I resolve this.
This is my code...
if I then inspect the size of the icon, android thinks the size is 100x100, when really is 150x150.
Looks like its reducing the image by the density.
Can anybody explain this and how to avoid this.
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 RelatedI'm connecting to a REST service using HttpClient under Android. I'd like to be able to write code where I could pull the host, port, etc. out of a properties file and not have to write fake Schemes and other things like that in order to do the development work. In other words, the live site will have a cert. The dev site will have a self-signed cert or a CA cert. Either way, I need the code to seamlessly work with both kinds of certs if possible. Can someone point me in the right direction?
View 2 Replies View RelatedI've just created some preferences using the PreferenceScreen XML following the Earthquake example from Wrox's "Professional Android Development" book.
Using the emulator, how do I accept the preferences?
If I use the back button I return a Activity.RESULT_CANCELED. So which key returns the Activity.RESULT_OK code?
I'm assuming you'll see this, but I'm just extremely curious.
It's a pain since I really can't find the answer for my questions anywhere else, and this seems to be the best place to ask as there are actual Google developers here.
Ive implement simple udp server on my Android device.(sdk 1.5) it works fine when i am running a local client on the phone sends through it trigger to my server. but when i try to get udp call from an outside server to my phone, it doesn't work. already make sure the outside server isn't blocked by firewall and it's sending the udp trigger to the right port, which my phone is listening to.
View 1 Replies View RelatedI am quite confused on this is InTouch mode or not for a View. Some of the apps I have seen can accept touch and keyboard requests that the same time but I cannot figure out how they are doing it. This is what happens in my app. Please shed some light on why this happens. If I touch the screen the keyboard is no longer responsive until I ackmoved the TrBall which takes me out of touchmode. I have used apps that seamlessly go from touch and keyboard without the need of moving the trackball.
View 4 Replies View RelatedI have been trying to setup a Droid to Droid 3G connection. I can confirm that all works great in wifi mode. The Droid can make connection requests (Http, Telnet, raw sockets) in 3G, but I cannot get the Droid to accept a socket connection in 3G mode. I am using the java.net.ServerSocket class. If anyone knows how to program the Droid to accept socket connection requests over 3G, please respond. Also, if anyone knows why this is not allowed please respond.
View 1 Replies View RelatedI am trying to setup at ServerSocket on my Android phone, and send a char or int or anything from my computer. The code on the phone creates a ServerSocket and then blocks whilst waiting for a connection(plus some more bits if the socket is created. But I'm not getting this point, so left that out!)Basically, the phone is getting to accept, and the computer is not connecting. The xx.xx.xx.xx is the public IP of the phone I obtain programatically (and it matches up with checking on whatismyip.com).I have set the INTERNET permission on the phone. I have also been able to do this in reverse (ServerSocket on pc, client on phone).
View 2 Replies View RelatedI'm trying to implement my own phone call handling UI. What I want to do is, if a call comes in, the incoming telephone number and a picture are displayed, and, if I press a button, the incoming call will be accepted/answered.
Sadly, the code does not work. At first, an exception is thrown if I press my answer button:
ActivityNotFoundException: No Activity found to handle Intent {act=android.intent.action.ANSWER
Then I added an entry in the AndroidManifest.xml: I run the app again, there is no exception anymore. However, I doubt the incoming call is not really accepted. Because if the press the Android's screen answer button (green button), the incoming call is accepted and a green in call icon is also displayed on the upper left corner of the emulator screen, while my app doesn't.
I also read the Phone app's source code in android source. There is method such as acceptCall() in the Phone class. But these codes seem difficult for me to use, because there are many imports declaration in the code, such as :
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
And, if I add these imports in my code, there will be too many errors, such as : "The import com.android.internal.telephony cannot be resolved" What is the right and simple way for my problem?
I add a listview via Java into @+id/View01.
For some reason the items in the listview don't accept clicks.
Does anybody have ideas about possible causes? code...
I have a TextWatcher set on an EditText that changes the input type after a user types a number followed by a space. If the user types two numbers the input type switches and accepts the next character, but if the user types only one number and presses space the input type still changes but it won't accept the first character the user tries to input. I've tested this on Froyo and 1.6, it only happens on Froyo, 1.6 works like it should.
Here's the code:................
friend's need help on posting the feed in facebook when string contains double quote,at the time facebook haven't accepting. for example if the content is something like this, Help on posting "feed" in facebook for android. suppose i need to post above at the time the feed title is getting null because of double quotes,how can i replace it with the same i have to post.
View 1 Replies View RelatedAll SYMBIAN based end devices accept Java language Applications
(i)Does this mean that the applications made for Android would run in S60 ,without any modifications?
(ii)If not then what exactly we mean when we say the above statement? Is there any web link to which I can refer to?
(iii)What are the coding guidelines that we need to follow so that an Android application can be ported on S60 with minimum changes?
I accept and share my location however it doesn't set. It won't add the friends to my list, and if I exit and go back it shows the requests again.
View 1 Replies View RelatedI changed my hotmail account to an outlook account. The only problem now is that the stock android e-mail app doesn't accept my outlook account, it wants to know if it is a IMAP POP3 or EXCHANGE e-mail account... I don't know this stuff.
View 1 Replies View RelatedTo be plain, the android / xml widget reference material is poor at best.Rather than approaching the controls from an xml point of view, its all driven from a class point of view, which is clunky when you want to figure out how to build a good xml UI.Is there any decent documentation with design in mind (tag names, attribute names, etc) or is it just figure it out and struggle through the best you can? I'm on my 2nd android app and losing patience with hunting and pecking for the correct attributes / tags.
View 2 Replies View RelatedIs there one? I have "Professional Android 2 Application Development" by Meier and "Teach Yourself Android Application Development in 24 Hours" by Darcy/Conder. Both are mediocre at best. Neither is a decent REFERENCE, but rather they are basically structured as tutorials, without nothing in the way of reasonably comprehensive API documentation (which also, BTW, is woefully inadequate on the android.com site). And no sort of in-depth discussion of the structure of the system, so one could perhaps understand it rather than simply using the (inadequate) cookbooks.
View 19 Replies View Related