android

How do I make a list be printed as buttons in the xml file? (Android)

I want to make a loop that in my main.xml creates a button for each item in the list. But I cant see a way to loop in the xml file and create more buttons that way. ...

Making data persistent in android

In my application,there are some application specific settings, which should be available to me , next time when my application starts up. In other words i want the data to be available across the sessions of an application cycle. Can this be achieved without using database(sqlite). ...

Frequently updating widgets (more frequently than what updatePeriodMillis allows)

I want a widget showing a countdown for a user initiated tracking of a bus departure. I want to update the widget every minute or so, from when the user initiates the tracking to when the bus has departed (i.e. the time runs out). This widget needs to be updated more frequently than what updatePeriodMillis allows, which is every 30 seco...

Routing input to Bluetooth headset in android

Is it possible to record an audio (not a phone call) using the bluetooth input and not the device microphone? I am able to playback whatever am saying through device's mic but not able to figure out how to use the bluetooth mic instead. Any assistance would be greatly appreciated. (Edited) I got it working by using following two lines o...

Can't get layout info when creating activity.

I have this element in my layout XML: <FrameLayout android:id="@+id/FrameLayout01" android:layout_width="320sp" android:layout_height="380sp" android:layout_gravity="center" android:background="#99CC33"> </FrameLayout> And I want to get its position on the screen with getTop(), getBottom(),... but I want to do it only once. I was tr...

ProgressDialog nesting inside of another blank dialog

Hi folks, So I'm putting the finishing touches on an application and there's still one outstanding issue with the application as a whole. I display loading indicators in the form of ProgressDialogs while pulling data down from the web. For some reason or another, my ProgressDialogs are appearing to be nested inside of another blank d...

Barcode reading through blue tooth scanner in android

Following is my sample code to read bar code from a blue tooth scanner. protected void connect(BluetoothDevice device) { BluetoothSocket socket = null; try { socket = device.createRfcommSocketToServiceRecord(BluetoothProtocols.OBEX_PROTOCOL_UUID); socket.connect(); while(true){ //on some condition break; InputStream is...

Android - How to programmatically set button color.

I am reading in some data from a REST api and need to generate some buttons based on the information the app receives. Because I need the same buttons in many Activity screens I have extended Button to make a RachelButton and I set it up in the constructor. public RachelButton(Context context, Info info) { super(context); this....

REST and listviews refresh

Hi, In my app, I have different activities with listviews. The datas come from a server with a REST method, and it's only done once, when I start the application. The pattern that I'd like to set is to precharge all the listviews with the JSONs that I already have in local, and in parallel, launch a thread that get the new JSONs fi...

On Windows 7 (64 bit), do you have to install only 64 bit Java, and 64 bit Eclipse?

I heard that vendors do not all have 64 bt libs, so am wanting to only install 32 bit Eclipse, and 32 bit Java. However, I have run into IDE issues so wondered if it is all because I did not install 64 bit? issues http://stackoverflow.com/questions/3302797/cannot-connect-subclipse-to-visualsvn-on-windows-7 http://groups.google.com/group...

Get list of Non System Applications

I'm able to get a list of installed packages using the package manager, but this includes various system packages . Are there any filters i can apply on this list to only show the apps that would show up when bringing up the application list from the home screen? ...

Writing Objects from a thread in Android

I have a game object that I save like this in OnPause() try { final ObjectOutputStream os = new ObjectOutputStream(openFileOutput(gameName + ".sav", 0)); os.writeObject(gameObject); os.reset(); } catch (final Exception e) { e.printStackTrace(); } This works fine except on some of the older or slower phones it can someti...

How can I dynamically generate/draw a UI in Android?

I have an in-memory representation of a basic tree structure. I want to dynamically generate a representation of this tree structure in the UI and allow users to click on nodes to reveal (text-based) details about the node. The UI would conist of icons for node types linked via branches. How would you suggest I approach this? All the UI ...

ListView item height

Hello, I'd like to know how to specify the height of a particular item of a ListView from java code ? Thanks ...

Taking screenshot of Android OpenGL

Hello, I'm fighting from some time with taking a screenshot of Android OpenGL. The code I found is as follows: nt size = width * height; ByteBuffer buf = ByteBuffer.allocateDirect(size * 4); buf.order(ByteOrder.nativeOrder()); glContext.glReadPixels(0, 0, width, height, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, buf); int da...

Getting the same geolocation Google Maps provides for a user?

Hi, Are there any best practices for an app to get the same geo location as the Google Maps app? For example, my app lists nearby Sprockets based on a user's geolocation. Often the geolocation I come up with is different than what the Google Maps app comes up with (which is often more accurate). We can kind of do this if we have a Ma...

Set install location for Android 1.6?

I'm writing an application that is compatible with Android 1.6, but I would like to give users running Android 2.2 the option of moving the application installation to their sd card. How can I compile my application for 1.6, but still allow 2.2 users to install it to their sd? ...

Custom listview with multiple values in a row

Hello , im trying to implement a custom listadapter that is set to display only distinct values for each row via the sql query. In each row i want to implement a list of textview values that displays data from another sql query. How can i implement an adapter like this ? ...

How to list all imagens on the device?

How do I get a list of all images in my android device? update: Maybe there is a Content Provicer for all the images on the device.. (studying) update: Getting hot, MediaStore.Images have the information.. now looking for how to get it.. ...

Android Development 64 bit - Eclipse issues

I recently decided to make another application for the Android but I am having severe Eclipse issues. I'm running Windows 7 Ultimate 64 bit edition and my Eclipse keeps force closing whenever I try to do random things (such as saving, opening a file, building, etc). It does it randomly, I can sometimes save / run my application fine but ...