android

How Do I Add a number to the Launcher Icon Like HTC Mail Does?

Does anyone know how to accomplish adding to my application's launcher icon the circular badge with a number inside of it (indicating number of unread emails) like the HTC mail application does? I know how to do this for notifications, but not for the launcher icon. To clarify, it's not a widget, but an application icon. Thanks! Jeff ...

Buttons bellow ListView are not fixed to the bottom of the screen when the ListView is empty

I have a Layout which contains a ListView some buttons below it. What I want is for the buttons to be fixed to the bottom of the screen. When the ListView has several items (more than what fits the screen) the code is working properly and the buttons appear in the bottom of the screen. However, when the ListView is empty or does not r...

Android 2.0: Problem with registerReceiver (Bluetooth)

Hi, I want to use Bluetooth and therefore register a receiver in my activity: localBT = BluetoothAdapter.getDefaultAdapter(); IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND); this.registerReceiver(mReceiver, filter); Unfortunately the application crashes in the third line. Here is the code of mReceiver: private ...

PreferenceActivity: save value as integer

Using a simple EditTextPreference in my preferences activity: <EditTextPreference android:key="SomeKey" android:title="@string/some_title" android:summary="..." android:numeric="integer" android:maxLength="2" /> Is there a way that this configuration value would be saved as integer? Seems now it just allows to ente...

Displaying custom dialog

Alright, so I would like to have a custom dialog, but I cannot figure out for the life of me how to make it appear when the function is called. public void addHomework() { final Dialog alert = new Dialog(this); alert.setTitle("Add Homework"); alert.setContentView(R.layout.homework_item_entry); Button add_button = (B...

Balloon chat application issues

I am doing a simple chat application and I want to show balloons similar to the iphone's sms app. So I am doing an Activity with a ListView with a certain layout. This are my layouts: /* Activity Layout */ <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"...

Droid Losing Values (Android SDK)

Shorter version of the problem now that I've had a Droid user run some tests for me. My app is mainly a webview with thing's like image uploading that require more than that. In the webview's onPageStarted I call a method to show the image picker if the user is at a specific URL. In the onActivityResult I get the filename that they ...

ButtonClick -> ImageView on new screen?

I am developing an app that is gonna be like a "comicApp", but so far I've just created 2 buttons and then I got 2 .jpgs. So when I click the first button I want to show a .jpg file in a new screen. I got 2 layout XML's (Main and the one with the ImageView on it.) How do I create a new screen in the activity? This is what I got so far...

Android HelloViews Spinner Tutorial R.id and R.array can not be resolved.

Hello. I am having trouble with the Android HelloViews Spinner Tutorial. The error in HelloSpinner.java states that "R.id cannot be resolved" and "R.array cannot be resolved". The error in AndroidManifest.xml states that there is "No resource found that matches the given name (at 'label' with value '@string/app_name')" and "No resource f...

How to add calendar events in Android?

I'm just getting up to speed in Android, and today in a project meeting someone said that Android has no native calendar app so users just use whatever calendar app they like. Is this true, and if so how do I programmatically add an event to the user's calendar? Is there a common API they all share? FWIW we're probably targeting 2.x...

Android: Rotate to face

Does anyone know of an animation/method that can rotate an image around smoothly to face a point, such as where the user is touching? ...

Project ideas; helpful to a community

Hello, I am in a class now and looking for a good project to work on that would be helpful to a community of people. This could be a new project or maintaining or improving on a project such as an existing open source project. The project is for a group of 3 that will be working for at least a semester, the project doesn't necessarily ha...

How to access data from sqlite.

Hi how to access existing data from sqlite and how to implement the data in list view in android. ...

Detecting Android usage inactivity and setting a future alarm/intent to trigger

I have a repeating alarm setting, I have the activity being launched, the piece I'm missing is having this triggered after x minutes of inactivity. I'm considering keying off of SCREEN_OFF in a service and then setting an alarm and canceling it on SCREEN_ON, does anyone have an intent or other suggestion for this. I've considering poll...

Android: How to inject a <string> element into another <string> element in XML?

Hello everyone! I would like to know whether there is a way to insert/inject a <string> element defined in an XML file into another <string> element, doing that just with XML. For example I could have: <string name="author">Francesco</string>` and I am looking for something like: <string name="about_application">Author: @string/aut...

Android open ContextMenu on short click + pass item clicked details

lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { TextView text = (TextView) view.findViewById(R.id.btitle); registerForContextMenu(text); view.showContextMenu(); ...

Context menu shows up completely black

I followed the instructions and examples on Android website to create a context menu but mine shows up completely black and i cannot change any options in it ; anyone out there had the same experience and can help me solve this issue. FWIW, here are my class .java and the menu .xml files <?xml version="1.0" encoding="utf-8"?> <menu xml...

Anrdoid - Drag and Drop Between Views

I've found a number of code examples for implementing image, or view drag 'n drop in Android, and have implemented one that should go sme way to meeting my requirements. However, I need to be able to drag images from View A to View B (on the same screen), with a check that if the user lets go of the image anywhere outside of View B, the...

Import Android Test Project into Eclipse from Version Control

I have an Android Eclipse project and an associated Android Test Eclipse project checked into a subversion repository. Given a checked out working copy, how do I bring the Android Test project into an Eclipse workspace? It's easy to add the Android project to the workspace (just File->New Project->Android Project->From Existing Source ...

Error loading java.awt.font in Eclipse Android project?

I've seen a few places where this was asked but I haven't seen where it's been resolved. I've just installed the tools needed to develop Android applications. This includes, of course, Eclipse. When I try to open the res/main.xml file, I get the error 'could not initialize class java.awt.font'. I'm running the newest version of Eclip...