android

How to hook into the Power button in Android?

On an Android device, where the only buttons are the volume buttons and a power button, I want to make the app react to presses on the power button (long and short). How is this done? ...

How can I add an image on EditText

I want to dynamically add image in EditText. Is it possible? anybody knows please give sample code for that. ...

Android: Increasing the height of textview dynamically

Hello All, I have a class which inflates linearlayout. The inflated xml contains a textview. I want to change the height of that textview dynamically as per the content. ...

HTML5 apps available in Android Marketplace?

Are there any app built with html5 feature (such as canvas, video playback...) available in Android marketplace? I'm looking for html5 web apps wrapped as a native android app. ...

How to Display Menu Icons after clicking the More item in Android

Hello, if I have an Options menu in Android that has more than 6 items, Android adds a More item that shows the other hidden items, AS text! But I want the More button to display the extra items both in their text AND icon, how do I do that? ...

How can I do a fade animation when the user rotates the phone?

My app's main screen is a listview in portrait mode. When it is in landscape orientation it switches to an ImageView. I want to be able to animate a fading transition when I switch orientations. How can I go about doing this? ...

Having trouble getting Joda-time to run on Android.

Hello, I'm learning Android and have need for dates/times. I was recommended Joda-time by a colleague, which seems to be exactly what I need to make progress. Unfortunately, I'm having trouble getting it to work. I'm using intellij and this is Android 2.2. Steps I took: Download the Joda-time jar from the website. Intellij > File > ...

How can you set a custom tab label width in Android

Hello. I have a Tabhost in a horizontal scrollview that contains 8 tabs. The Label space for each tab is small and many of the labels have to scroll to be viewable. Is there anyway to make the tab labels bigger? This is my layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertic...

Problems with context when trying to display Toast

I try to display a Toast inside a AsyncTask. This first piece of code is placed in an activity that we may call MyActivity, and works fine: Toast.makeText(this, "Toast!", Toast.LENGTH_SHORT).show(); Then I create a new instance of MyObject and calls method(). This code is also placed in MyActivity. MyObject obj = new MyObject(this);...

Automatic selection of checkboxes inside listview - android

I am building a list and the list contain for every contact a checkbox to chose which one to modify for example, the problem is that when the list became longer than the phone screen and the scrolling is active; when i select a check box , a second one is automatically selected in the bottom of the list. the problem is the automatic sel...

Why won't my Activity start?

I'm trying to start an Activity with startActivityForResult, but I keep getting an ActivityNotFound exception, and I can't work out why. I've looked through the code multiple times, and it seems to be identical to some other, working code. Any suggestions? The newNoteButton that starts the Activity: newNoteButton.setOnClickListener...

Is there a way to know the what digits are being entered via the native dialer?

Is there a way to know what digits (digit by digit) are entered via an Android phone's native dialer? ...

Android, View width change animation?

I'm trying to make a timeout gauge bar animation effect: The width of a lengthy colorful bitmap image is decreasing, but not x-scaling. so the image looks not changing and the visible area shrinks. I couldn't find the sole ImageView clipping or masking support in android. And I managed to get the clipping effect by surrounding the Im...

The best way to play swf-files (flash) in my android-program?

I have to play flash (swf) in my program when the user clicks on a link. Which is best? Concentrate on android 2.2 and use the Adobe Flash Player, or what do you recommend? I have tested WebView, but can not play swf in the emulator. HTC has a custom flash player but it feel like a limitation. Some code samples to play swf in android t...

Android newline in my EditText

Hi, i got some data like this "line 1 \n line 2" from my distant server by using json with utf8 encoding, and when i try to put the data in my EditText the newline \n doesn't work in spite of unscaping the data by using URLDecoder.decode() because i use databases. Any suggestions all the best . ...

Upload a photo from camera to PHP server

I have 3 days into this and my mind is melting oozing out my ears.... please help! The end result is that I want to upload selected photos from and Android phone to a php website. I can display the images from the camera and get the filename that I want to upload. However I cannot use FileInputStream on the file name because it is no...

Android :: TextView :: Programitic Creation with setSingleLine(false) - Not wrapping

I'm setting a textview as a child to a TableRow view programmatically and I cannot seem to get the text to wrap inside of the parent. Here is the code which should be wrapping the text inside of the TableRow. Notice the setSingleLine is being set to false. TextView value = new TextView(this); ![alt text][1]value.setLayo...

Is there a way to load and draw partially a bitmap from file in Android?

Say I have a somewhat large (i.e. not fit in most phones' memory) bitmap on disk. I want to draw only parts of it on the screen in a way that isn't scaled (i.e. inSampleSize == 1) Is there a way to load/draw just the part I want given a Rect specifying the area without loading the entire bitmap content? ...

Android live wallpaper doesn't seem to quit?

I've tried running a variety of live wallpapers. When I set a different one to be live, the old one still shows up in the adb shell when I type 'ps': app_37 12107 1870 125356 16932 ffffffff afe0da04 S fishnoodle.aquarium_free app_50 12196 1870 109620 16804 ffffffff afe0da04 S com.geekyouup.android.snowpaper My own one that I...

Android: EditText field too high

I have a table with cells mixed from TextView and EditText fields. For some reason all EditText fields use a bigger font than TextView (20dp vs. 12dp) and they also ignore their textSize attributes. Furthermore all EditText fields have a height that would easily fit TWO lines even though I explicitly specify a line height of 1 only. Any...