android

How to cancel AsyncTask when Activity finishes?

In my Activity I use multiple AsyncTask classes. How to cancel AsyncTask when Activity finishes? ...

Android and Google Maps API - Icons

I want to place markers on the map. I want to use the standard Google Maps icons for markers. how do I use them? I don't want to create my own icons. I'm developing for Android. in the documentation they tell me to create a class that overrides ItemizedOverlay but in the constructor I'm asked to provide a drawable object. how do I poin...

Installed Android on Mac, cannot find SDK

Using Mac OS X 10.6.2, Eclipse SDK 3.5.2. I installed the Android plugin, following the instructions at: http://developer.android.com/sdk/eclipse-adt.html In the next section (step #3) it says: For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. I cannot find such a directory. When I try so...

Drawable folders in res folder?

What is the difference between the three drawable folders in the res folder in the project hierarchy? If I have an image to put into a folder, which folder do I put it in? ...

How to test code built to save/restore Lifecycle of an Activity?

How can I test all of the following methods code? I want to play scenarios when all of them are happening to see if my code works for save/restore process of an activity. So what should I do in the Emulator to get all methods tested? public class Activity extends ApplicationContext { protected void onCreate(Bundle savedInstanceStat...

Trying to setup android sdk on PC with windows XP

When I start setup I get this message: XML verification failed for http://dl-ssl.google.com/android/repository/repository.xml. Error: cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'. Failed to fetch URL reason: Unknown Even when I force the download to use http nothing happens. I get no downloads etc for the SDK...

Syntax highlight in java for android

I want to build an notepad-style application on android that will have syntax highlighting. But when I search around the web, I find the syntax highlighting can be done only through use of an awt class. How could I syntax highlight in maybe a custom EditText or TextView view? I know that the release of a syntax highlighter is sort of ant...

android include tag - invalid layout refernce

Hello, I'm having a problem including a different layout through the include tag in the android layout xml file. When specifing the layout reference ( @layout/... ), i'm getting a InflateException in the Eclipse ADT with the following error: InflateException: You must specifiy a valid layout reference. The layout ID @layout/func_edit_si...

Make service indepented from activity (Android).

I have an activity with two buttons, start and stop. If the user press the start button a service is created using Context.startService. And the stop button calls Context.stopService. I want the stop button to be the only way to destroy the service. Now, if i end the activity using a task manager, the service is killed as well. Is ther...

Attach a bitmap on another bitmap

I have a class Building. It contains a _bitmap object, referenced to a drawable. I can draw it on an external View, where its canvas calls myBuilding.getBitmap(). Now I want to draw some windows on the building, but I need them to be "tied" to the building, so that translating the x and y of myBuilding, the windows move together. Is th...

Install app on Motorola Backflip from AT&T

I'm trying to test an app out on the Motorola Backflip with AT&T as the carrier. I checked USB debugging on the phone's Development screen. Using Eclipse, how do I get the app to load on the Backflip so I can test it? DDMS shows a device with a bunch of question marks and unkown. Seems that it only gives me the option to load the a...

How do you validate the format and values of EditTextPreference entered in Android 2.1?

Does anyone have sample code to validate user entered text in preferences? For example, I have a EditTextPreference for user to enter an email address. I'd like to validate the format of email address entered and pop up an alert dialog if the format isn't correct. Anyone have any sample code for this? Thanks ...

Problem with EditText.requestFocus()

In the onCreate() of an activity, I've got a call to requestFocus() on an EditText. Immediately after, I've got the following: System.out.println(mEdit.isFocusableInTouchMode()); System.out.println(mEdit.isFocusable()); System.out.println(mEdit.isFocused()); These were just put in while I was trying to figure out what is ...

Activity in Android

Normally, a Java p'rogram starts from an object, then that object will create some GUI objects (window) and call the "Show" method So, is there any way to do the same thing in Android, since, by default in Android, a program runs from an object created by a class which extended from Activity class? ...

Android Update Layout Content

I'm looking for a way to update a layout's content with a new view. Is there any way to easily do this. It would be similar to how tabs work, but I don't want to have to get into extending the current tab structure if I don't have to. The final result would be a few buttons that would switch the content in a specific linearlayout for e...

display data after every 10 seconds in Android

I have to display some data after every 10 seconds. Can anyone tell me how to do that? ...

Doing coding in Linux through a virtual machine on Windows VS partitioning

I already have experience with setting up virtual machines, running them and other minor tasks. Im a gamer, so I wont get rid of windows (for now at least...) but I do want to be a great programmer and to be involved with the Open-Source community. Id like to know if its a good idea to do my programming in linux through a virtual machin...

Please Help : Error - The import com.google can not be resolved

Hi, i am new to android development. I got an error when write the code "import com.google.android.maps.MapView; in eclipse. The error is "The import com.google can not be resolved." Please anybody give suggestion to fix this problem. ...

Android SDK and AVD manager will not run from Eclipse after upgrade to SDK 5 and ADT 0.9.6

Using Windows 7, 64 bit system. Prior to upgrade I was able to run "Android SDK and AVD manager" from Eclipse via a tool bar icon and menu option, both of which still exist. However now nothing happens when I try to run the manager. As a result I can't start an emulator from within Eclipse. When I use Eclipse to run an Android app, th...

How to determine the format of Excel file in Java?

I am working on a light weight Java client library for Android mobile platform that can read and write to Excel files in .xls(BIFF) and Office 2003 XML format. No sooner we decided to start than we got stuck with a basic question. How do we determine the format of the excel files in Java? Please help. Thanks. ...