android

Bluetooth service problem

hi I need to create a custom bluetooth service and I have to develop it using c++. I read a lot of examples but I didn't success in publishing a new service with a custom UUID. I need to specify a UUID in order to be able to connect to the service from an android app. This is what i wrote: GUID service_UUID = { /* 00000003-0000-1000-80...

Check orientation on Android phone

How can I check if the Android phone is in Landscape or Portrait? ...

Setting acquired location to a text view: How to maintain?

Hi, I have built an app for the Motorola Droid which should automatically update a server with the phone's location. After the user performs a particular task on the main activity screen, an alarm is set to update the user's location periodically, using a service. The alarm is explicitly stopped when the user completes another task. Th...

Same Activity called twice... Issue with Multiple AsyncTasks?

I have three simultaneous instances of an AsyncTask for download three files. When two particular ones finish, at the end of onPostExecute() I check a flag set by each, and if both are true, I call startActivity() for the next Activity. I am currently seeing the activity called twice, or something that resembles this type of behavior. S...

Key Events in TabActivities?

I have a TabActivity and want to catch and handle presses of HOME and BACK. Where do I need to catch these events? In my subclass of TabActivity I implement the following: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { // Code handling } return super.onKeyDown(keyCode, event); ...

Best practice to calculate the average speed from GPS coordinates

i have here a device which can give me gps coordinates. the time intervall i can define. i want to use it to calculate the average speed during driving or travelling by car. actually i used a orthodrome formula to calculate the distance between two points and then divided it by the given time intervall. by the implemenation i followed th...

Set width of Button in Android

How can I set a fixed width for an Android button? Everytime I try to set a fixed width it fills the current parent (the RelativeView). Here is my XML: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/relativelayout" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://sche...

Hide Soft Keyboard Not Working ...

I'm developing on the Droid Incredible (and have tested on a 1.5 AVD Emulator as well), and one of the tabs in my tab widget consists of a listview and a row with an EditText and a Send button (for a chat feature). I am using the following to close the soft keyboard once I click Send, but it's not working. This is identical to code I've ...

Speed/expensive of SQLite query vs. List.contains() for "in-set" icon on list rows

An application I'm developing requires that the app main a local list of things, let's say books, in a local "library." Users can access their local library of books and search for books using a remote web service. The app will be aware of other users of the app through this web service, and users can browse other users' lists of books i...

Android installation in a mobile

Is it possible to install Android in a normal mobile phone? I have Sony Ericsson Naite which has only key pad interface (No touch). I would like to install Android in my phone for experimenting with it. It will be great if its possible to dual boot Android with Symbian :-). Do we need any other special hardware to install operating sy...

How to port Iphone style app into Android?

first, please see the blog as the link showed below: http://blogs.nitobi.com/joe/2008/10/17/phonegap-now-for-android/comment-page-1/#comment-12918 the author made iPhone Style app in Android emulator, the pic showed below: http: blogs.nitobi.com/joe/wp-content/uploads/2008/10/droidgap.png if anyone knows, Would you please tell me how...

How do I get the WVGA Android browser to stop scaling my images?

I'm designing an HTML page for display in Android browsers. Consider this simple example page: <html> <head><title>Simple!</title> </head> <body> <p><img src="http://sstatic.net/so/img/logo.png"&gt;&lt;/p&gt; </body> </html> It looks just fine on the standard HVGA phones (320x480), but on HDPI WVGA sizes (480x800 or 480x854) the buil...

Android AudioRecorder object wont read from microphone.

I'm trying to build a voip application on a new android device, i use AudioRecorder to read the microphone but I'm getting no valid results, just white noise. This happen only on this new device(other work well) and this is probably because this device has PTT ability. Is there some workaround to avoid using AudioRecoder to receive strea...

TabHost remove all content activities

I have a code for populating content for tabs dynamically. First time it works ok, but when I want to replace tabs (and their content) with new content - tabs are changed but tabs' contents are not, how can I clear completely whole TabHost and replace with other content? TabHost tabHost = getTabHost(); Intent intent; TabHost.TabSpec spe...

Wifi functionality

Hello Does anyone knows if the wifi networks for android phones are based on Access Point Names (APN) ? I ask because in my android application I plan to overwrite some fields in all APN's to disable cellular network, but I still want to have available the wifi for the user ...

Why are my images compressed?

I'm using layout xml file for the UI. But the images are compressed and the qualities have lost in some level. My code is like this: <ImageView android:layout_width="480px" android:layout_height="717px" android:layout_x="0px" android:layout_y="45px" android:scaleType="fitXY" android:src="@drawable/e4" /> The d...

Selling an application both in the android market and outside it

I understand it is possible to sell the same application both in the market and outside it, great. I still don't understand a few things, that AFAIK are not mentioned in the contract but I might have missed or misunderstood something, so I'm going to ask. Disclaimer: I know you're not a lawyer, etc. etc. Let's say I give in the market...

AddProximityAlert Disappears Although Expiration -1

Hello, I want my app to have a proximityAlert until the user removes it. I use expiration -1 to create this proximityAlert. The proximityAlert works. But I find on my Droid phone, after adding a proximityAlert and leaving the phone over night for charging, the proximityAlert does not work the next day. How can I make sure that my pr...

ProgressDialog - how to remove the numbers

I was following the progress dialog example in the ApiDemos. all went great except for one thing - I want to remove the numbers that appear underneath the bar (those running numbers that run from 0 to .getMax(). couldn't find how to do it. anyone? Ori ...

How to correctly handle click events on Widget

There is a task to make smt like todo list on widget (with dinamic number of elements), how to organize this list for click support on this elements. I only found how add click event on one widget layout element (with setOnClickPendingIntent), and how send text to widget element TextView. But it's unclear how handle click events for sub...