android

Drawing top border on a shape on Android

I'm creating a custom progress bar (positioned under a WebView) and what I would like to draw is a 1dp-wide line between the WebView and the ProgressBar. I'm modifying existing drawable, namely progress_horizontal.xml, and tried something like this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android...

android View not attached to window manager

I am having some of the following exceptions: java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:191) at android.view.Window$LocalWindowManager.updateViewLay...

Is this a built in drawable?

In this linked image , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable? ...

How to get the absolute coordinates of a view

Hi, I'm trying to get the absolute screen pixel coordinates of the top left corner of a view. However, all methods I can find such as getLeft() and getRight() don't work as they all seem to be relative to the parent of the view, thus giving me 0. What is the proper way to do this? If it helps, this is for a 'put the picture back in ord...

Android app with multiple activities

I have a very simple game that consists of only one activity, and I want to add a title screen. If the title screen is another activity, what changes do I need to make to my manifest file to make the title screen open first? The gameplay activity is called Leeder, and the title screen activity is called LeederTitleScreen here is my cu...

Saving CookieStore in http client service

I have a Service for my Android app that performs HTTP calls. The Service stores cookies in a CookieStore. I am trying to find a way to persist the CookieStore but I haven't been successful. I don't want the user to log in every time to receive a new CookieStore. I tried to use SharedPreferences to store the CookieStore as a string, bu...

How to use an ImageSwitcher without a Gallery

In looking at the ApiDemos example in the Android (1.5) SDK, there is a fine example of using an ImageSwitcher, with a Gallery object to provide the "change image" actions. The application I'm looking to write, starting into Android development, has three images that I want to be able to pane/scroll through, so ImageSwitcher looks like ...

Android Notepad Tutorial Crashing

I'm trying to run the Android Notepadv3 app on the Motorola Droid. When I am creating a new note, if I rotate my phone so that the view should switch to horizontal, or if I open it up so the keyboard is exposed, the app freezes and crashes. I haven't modified the program in anyway from Exercise 3 solution (http://developer.android.com/r...

How can I write my own context menu for copy & paste?

I'm writing an application with EditText driven widget. and I'd like to create my own copy & paste menu. To replace android default menu on EditText, what should I do? Just overriding long click? or is there another way to implement? Thanks in advance. ...

What's a good library for parsing mathematical expressions in java?

I'm an Android Developer and as part of my next app I will need to evaluate a large variety of user created mathematical expressions and equations. I am looking for a good java library that is lightweight and can evaluate mathematical expressions using user defined variables and constants, trig and exponential functions, etc. I've look...

Running an Android App in Eclipse Causes NullPointerException

I have been following the Android getting started docs and when I try to run the project I get: !MESSAGE An internal error occurred during: "Launching HelloAndroid". !STACK 0 java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source) The application doesn't laun...

How to build Dialer/Phone application from the source code?

Hi i am trying to write test cases for "phone" native application , so i am trying to build that application from the source code... It has some dependency with the Contacts app , i am not able to resolve that . Any help regarding writing test cases for phone app or help on building it is very much helpful. Thanks in Advance. ...

How do I fill a ListView (in Android) with XML or JSON data?

I read a tutorial, and it uses SQLlite and "SimpleCursorAdapter" to fill the list with items. This is the code the tutorial taught me. private void fillData() { // Get all of the notes from the database and create the item list Cursor c = mDbHelper.fetchAllNotes(); startManagingCursor(c); String[] from = new...

how to get the images from device in android java application

in my application i want to upload the image.for that i have to get images from gallery in android device.can pl send me that code get images from android device gallery ...

Android: Draw a scalable rectangle(Should change colours on my input)around a bitmap

Hi All, Can anybody help me to draw a scalable rectangle around a bitmap And such that 1) The rectangle should scale based on the size of my bitmap 2) The colour of my rectangle should change on my input any help would be appreciated Thank you ...

How to get Latitude and Longitude of the mobiledevice in android?

How to get the current Latitude and Longitude of the mobile device in android? ...

Need help in using androi layout trick #1

Hi, I have read this blog entry about using relative layout to optimize layout in ListView: http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html I have used this layout for my ListView Item (with a slight modification of the example): <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

Can I get speech recognition in language other than English on Android?

I am trying to build an application (which would use the Hindi language and other regional languages) to get speech voice commands. I also need text to speech functionality in my application. I was wondering if there was any way I could get a speech recognition library on Android? I did a quick Google search and found a couple of libra...

Add twitter feature for android application

Hi all, Working on android application, wanna add twitter feature to it , like after every commute send the twit to the user account . Is it possible to add twitter into the android app without asking for user's twitter account details (user_name and password). I think using Twidroid it is possible but i dont know how to proceed .Ple...

Is there on install event in android?

Is there some event/receiver or something for handling first execution after installation or directly after installation? Or Do I need it emulate with preferences? ...