android

Android 2.0 SDK map not showing

I'm using IntelliJ IDEA 9 (9.0.1) to create a simple map application (or at least trying to). I'm using Android 2.0 with Google API's 2.0. Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example"> <application android:icon="@drawable/icon" ...

Dynamically enabling or disabling a widget does not work

We would like to enable or disable widgets via code. When we say "disable" we mean that a widget which is registered in an application should not show up in the list of widgets available to the user when they try to add a widget to their home screen. This question has been asked, unfortunately, many times without answer. There w...

Launch an Android dialog box from a View

I have an Android Activity that uses a class that I developed that extends a View (let's call it FooView). I'd like to launch a dialog box when a particular event happens in FooView. It seems from all I've read that the dialog box must be launched from the Activity class using showDialog(). I can't seem to find any example showing how...

What is the easiest way to draw texture with OpenGL ES?

I saw this Google IO session: http://code.google.com/intl/iw/events/io/2009/sessions/WritingRealTimeGamesAndroid.html He says that the draw_texture function is the fastest and VBO is 2nd faster. But I don't understand how to use it(the draw_texture method or the VBO way). Any suggestion? ...

java.lang.IndexOutOfBoundsException: getChars (7 ... 0) has end before start

My users are sending unhandled exceptions to me via http://code.google.com/p/android-remote-stacktrace/ I am getting the following but have no idea what it means. java.lang.IndexOutOfBoundsException: getChars (7 ... 0) has end before start at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:935) at andro...

How to Get Serial Number or ID of Android Emulator After it Runs?

If I run several emulators with -no-window option in one machine. The command "adb devices" shows: List of devices attached emulator-5554 device emulator-5556 device emulator-5558 device ... However, according to this output, I can't tell the difference between each emulator device at all. I need to know which emulator runs on what...

Creating a phone software lock Application for android

Hi All, I need to create an Application that can lock the handset at some specific Event. either i want to make use of Require Pattern programatically. or create a lock application, just like windows mobile in which there are digits to be entered instead of a Pattern. please guide me to the path if creating this application is possibl...

[Android] Returning to a ListView with a text filter

I enabled text filtering on my ListView in the expected way; adding android:textFilterEnabled=”true” in resource definition and (as I'm using a SimpleCursorAdapter) setting a FilterQueryProvider that provides a filtered cursor like so: public Cursor runQuery(CharSequence constraint) { Cursor cur = mDba.fetchTrackers(mCurrentGroupId,...

Android AnimationDrawable and knowing when animation ends

I want to do an animation with several image-files, and for this the AnimationDrawable works very well. However, I need to know when the animation starts and when it ends (i.e add a listener like the Animation.AnimationListener). After having searched for answers, I'm having a bad feeling the AnimationDrawable does not support listeners....

Android - how to disable long press on Search button (Nexus One)

The Android documentation describes how to disable the search the search feature in Activity: public boolean onSearchRequested() { return false; } This works fine for a short press of the search button on the Nexus One. However, it doesn't disable the long press, which still fires off a voice search. How do I disable the long pres...

Android View onKeyUp() not getting called

I am a new comer to Android development so I imagine I have a simple problem, but I can't seem to figure out what's wrong. I basically copied the LunarLander game example from the samples, but I tried to to only copy the parts I needed to make a little pong game or something. But for some reason, onKeyUp and onKeyDown are not getting c...

Inserting the current year into a TextView

Hi everyone, Just a small problem really, I'm wanting to place the current year into the footer of my apps. Each footer is a TextView and is seen on menu screens etc. Is there a way to insert the year into this dynamically? Cheers, Laurence ...

Android: How do I switch the image of an ImageButton when the user releases the button?

I'm trying to make it so that as long as a user is touching the button, it shows one image, and when the user releases the button, it goes back to a default image. I'm trying to use a selector to make this happen: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; <item and...

Alignment of View Elements within a LinearLayout

I hate to ask this question; for some reason I can't figure it out on my own. I have a vertical LinearLayout that contains a custom View that I've defined in my app and and a TextView. I'd like my custom View to be aligned on the top of the screen and the TextView to be aligned at the bottom of the screen. Unfortunately, no matter wha...

How do I determine the points in a line, in order, from P1 to P2?

Hey guys. I'm trying to make a simple game for Android in which the player drags a space ship with one thumb and fires at enemy ships by tapping empty space with the other thumb. Thing is, to animate the bullets traveling across space, I need the list of points between the user's spaceship, and the end of the screen, the line passing thr...

Context menu before sending SMS

if google voice is installed on your phone, when you dial a phone number a context menu pops up asking if you want to dial with or without google voice. I would like to accomplish the same task for dialing a number or sending a text message. Does the API allow you to do that? It seems there is a process_outgoing_calls, in the permission...

Is it possible to run the Android emulator as root from NetBeans on the Mac

I have installed NetBeans 6.8 on my Mac OS X (Leopard) system and use the Kenai plugin for this platform to create an Android application. The trouble is that I cannot run the Android emulator from NetBeans logged in to the Mac as a normal user. I can run the emulator from the command line and the Eclipse environment when logged in as ...

In Android, how do I download the HTML of a webpage?

In Python, I use a class called "urllib". I'd just like a simple function where I can download the HTML of a webpage. ...

Editable text to string

How can I convert editable text into string in Android ? Any solution? ...

In Android, how would you develop this? (activity and views question)

When the user opens the application, there is a screen with a button on it, which says "login." The user clicks on the button, and a webview pops up to allow him to log in to the website. After logging in (the app would need to know somehow), the webview would disappear, and then a list of usernames will pop up. (ListView?) When the u...