android

Set inputType for an EditText?

Hi, How do we set the input type for an EditText programatically? I'm trying: mEdit.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); it doesn't seem to have any effect. Thanks ...

Counting XML elements in file on Android

Take a simple XML file formatted like this: <Lists> <List> <Note/> ... <Note/> </List> <List> <Note/> ... <Note/> </List> </Lists> Each node has some attributes that actually hold the data of the file. I need a very quick way to count the number of each type of element, (List and Note). Lists is simply the root and doesn't matter. ...

Android Orientation

For a game I am trying to create for Android I am looking for a way to use/access the orientation yaw/pitch to move the player left or right. Does anyone know how to do this, or where to find a tutorial? ...

Lablayout and Linairlayout

Hi, I am trying to make a app with the tuotrail of the developerspage, then I would like to display a main.xml in a tabview, instead the textview, wich in the tuotrail,is in the activity. How do I tell my tab in activity do display the main.xml? Thanks! ...

Help with ListView Databse

I am having issues @ run with this code: App Force Closing.. Sprinter.Java import android.app.ListActivity; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.widget.ListAdapter; import android.widget.SimpleCursorAdapter; public class Sprinter extends ListActivity { ...

Does html5 video work on android nexus one with android version 2.1?

I'm trying to get an html5 demo page working on Android 2.1, have tried both droid and nexus one with 2.1 but they only display the poster image, and do not play the video. Pressing on the video does not do anything. Edit- resolved with the onclick handler on the video tag Is it possible to use html5 video in the android 2.1 browser a...

Is there a design pattern to cut down on code duplication when subclassing Activities in Android?

I've got a common task that I do with some Activities - downloading data then displaying it. I've got the downloading part down pat; it is, of course, a little tricky due to the possibility of the user changing the orientation or cancelling the Activity before the download is complete, but the code is there. There is enough code handli...

Android Force Recycle Large Bitmap?

From another stackoverflow question, it seems that Android handles large bitmaps differently than other memory. It also seems like there is a way to force Android to recycle the bitmaps to free up memory. Can anyone enlighten me on how to do this. My application uses 2-6 huge bitmaps at all times, so it nearly kills the phone's memory ...

Making a Text-To-Speech Wrapper in Android

I am attempting to create a wrapper class for Google Android's Text-To-Speech functionality. However, I'm having trouble finding a way to have the system pause until after the onInit function has finished. Attached at the bottom is something of a solution I created based on what I found here: http://stackoverflow.com/questions/1160876/...

How to create notification icon badge on Android apps (like iPhone)

I am very new to programming and would like to know what is the best way to go about creating a notification icon badge similar to the ones on the iPhone apps. This would be basically for creating a badge for the notifications that end up in the notification bar. ...

Android OpenAL?

Has anyone built OpenAL for the Android, or found the shared library for it on the system? This seems like an obvious need for a game of any kind, yet there's no resources out there for it. It seems the Android java sound library can't do pitch changes from what I can tell, so there seems a need for OpenAL. I know OpenAL Soft can be b...

android: how to align image in the horizontal center of an imageview?

I've tried all scaletypes, but all of them result in the image to be at the left corner of the imageview. <ImageView android:id="@+id/image" android:scaleType="centerInside" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="6dip" android:background="#0000" ...

Centralized database/app hosting

I am writing an app that will require a centralized database, along with a small app to digest incoming file data and populate this database. android phone -> file -> some app somewhere -> some database somewhere I know this is probably a fairly common situation. Is there a particular hosting service/solution for this? Many apps must...

Need help getting buttons to work...

I am trying to get my first button to update a display number in my view when clicked. This view will have several buttons and "outputs" displayed. After reading examples and Q's here, I finally put something together that runs, but my first button is still not working; public void onCreate(Bundle savedInstanceState) { super....

Android "Hello World" Problem...

Hi, this is the code i have written package com.test.AndroidApp; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class TestAppActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { supe...

What is the difference between Extends Application and Extends Activity in Android?

I am confused as to the difference between the two. In my application I have just used Extends Activity and the application is working perfectly, so what is the purpose of Extends Application?. Would you use it on the first class you create in the Android application? Thanks. ...

Someone please help google create instuctions that windows users understand. googles "instructions" for the Android NDK install.

Below are the only instructions i managed to find from google on how to install the android NDK, it is written as if we all run Linux and presumes we all understand what these obscure tools are. My comments and questions appear in Italics if somone who knows unix and windows would translate for google that would be great! Android NDK ...

two android threads and not synchronized data

i have a (perhaps stupid) question: im using 2 threads, one is writing floats and one is reading this floats permanently. my question is, what could happen worse when i dont synchronize them? it would be no problem if some of the values would not be correct because they switch just a little every write operation. im running the applica...

openGL ES gpu thread on android devices

does anyone know what part of the opengl es thread on an android device runs on the gpu (if it has one). just the method calls you make with the GL10 adapter class? or the complete onDraw method in your custom Renderer class? ...

Easiest way to export longitude and latitude data stored in a SQLite database to a file so it can be imported to a Google Map API through a website?

Hello, I have created an application that records a series of longitude and latitude values in a SQLite database and display them as a coloured track on a MapActivity. I now want to be able to export this data somehow (preferably to a file) so a user can upload the values to a website showing a Google Map API. My question is: what wo...