android

having difficulties adding new xml to my project

when i open a new xxx.xml file it doesnt write to the R.id my new var example when i write in xml : <__Button android:text="New Game" android:id="@+id/newGameButton" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> (the _ r from this web format boundaries ) in R it should write : public stat...

How do I get the time when the Location has been updated in Android?

As you know we can get thast Last Known Location, but how do we get the time when that has changed? ...

[Android] How to keep TabHost at portrait orientation and listen for configChanges (orientation).

Hi guys, Could you advise how to keep TabHost with all tabs at portrait screen orientation and at the same time listen for configChanges = orientation? I am going to show another activity when orientation is changed. Seems to me configChanges (orientation) event does not fire when screenOrientation is set to portrait mode. Thanks for ...

Froyo (Android 2.2) source code

Is the Froyo (Android 2.2) source code available? I've browsed the Android code repository using gitweb and haven't found an Android 2.2 tag or a froyo head. ...

Turning on screen programmatically

Hi, I would like to unlock screen and switching it on to show a popup on an event trigger. I am able to unlock the screen using newKeyguardLock = km.newKeyguardLock(HANDSFREE); newKeyguardLock.disableKeyguard(); on KeyGuardService but I cannot turn on the screen. I am using wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, HA...

App cannot start at all in Android 2.2 (Froyo)

My app has been running okay until the recent Froyo update. After installing the Android 2.2 SDK, I can compile my code without any errors. However, when I run it, it just force closes: Here's the log: 05-23 10:15:13.463: DEBUG/AndroidRuntime(423): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 05-23 10:15:13.463: DEBUG/AndroidRun...

Efficiency questions

Hi, I have to manage XML documents and Strings in my app. In terms of efficiency and memory usage, will a collection like ArrayList be much more expensive than String[]? Also, I could store the content as a regular String or XML. Is working with XML also more expensive? (When I say expensive, I am referring to the use of system resourc...

Reference to XML file is not a member of the R file

How can I had to class layout in R another XML file? It should be automatic as I had new resources to res, but it's not. Someone knows what I did wrong? I open an activity and now I want to open another activity that will work with another XML example. I have menu and main.xml. Now I want to go for another activity called gamescreen us...

Sending a Java object from my Android phone to my Computer

Hi, I was wondering what the simplest program for sending an object from my Android phone to my computer wirelessly (via LAN) would be. I have created Java RMI programs with a server and multiple clients, so I have a grasp of the concept. However with android I'm just not sure where to start. What I am aiming to do is send some sort of...

Android: Dynamically add custom checkboxes to a tableLayout

What should I do to use custom checkboxes if I add my checkboxes dynamically in my code? (On the java code not on the XML files.) I'm following this tutorial, but using it I can't achieve my goal. For example, I have a tableLayout and I want to add a checkbox for each new row I have. Thank you all. ...

how to release android camera without surfaceDestroyed function?

hi guys i am working with android camera stuff.i am developing a software.i am taking photos and just after i took picture i wanna release the camera but i am having some problems.i am looking forward to hear your answers about how to solve it ...

UiModeManager - NightMode (FroYo)

Hi there, I have been trying to turn off the buttons' light in my application using the UiModeManager's nightmode function. The default Desk Clock application (Nexus One) turns off the buttons' light when it is dimmed, and I want to do this as well. I've tried using the following code: UiModeManager mgr = (UiModeManager) getSyste...

ClassCastException when casting custom View subclass

Hi I've run into an early problem with developing for android. I've made my own custom View (which works well). In the beginning i just added it to the layout programmatically, but i figured i could try putting it into the XML layout instead (for consistency). So what i got is this: main.xml: [...] <sailmeter.gui.CompassView android:...

Android OpenGL glDrawElements works on 2.1, but not 1.6

I have a very simple GLRenderer subclass that draws a bunch of polygons on the screen. On my Nexus One with 2.1 installed, I see exactly what I expect. On my G1 with 1.6 installed, I only get the glClearColor displayed. I can alter the color, and see that my onDrawFrame function is at least partially functioning. I can't fathom a good e...

Add menu option to SMS interface

Hi, I'm looking for a way to add a new custom menu item to the SMS interface. The idea is add an option like "Insert predefined message", and control the predefined message from other application. Is this possible? ...

Explain to me how the Method Profiler works in the DDMS, I get heap space error

I start the Method Profiler for a process, then leave it run for about 5-10 secs, then I stop it. I see a progress that a file is pulled from the sdcard, than I get this Exception The trance file is 8.2MB [2010-05-23 18:45:42] Traceview: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space [2010-05-23 18:45:42] Tracev...

Implement Delegation in Android

Is there a way to implement delegation in Java for Android? Or does the activity class automatically ? My friend is an iPhone programmer, so he uses delegation in the form of an HelloWorldAppDelegate. How could delegation be implemented in Android? ...

How to remove auto focus/keyboard popup of a field when the screen shows up?

I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying How can I make sure that when the activity is started the focus is not gained, and/or the input panel is not raised? ...

Re-load Android activity data

Hi, I am writing an Android app, part of which will be a survey involving multiple pages of checkbox question and answers. I have created an activity to display the question and options (from the DB) and what I want to do now is when i press the "Next" button it should just reload the current activity with the next question set from the...

How to search a pdf after opening it from a new intent?

I've used the code from the PDF rendering question http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android And it works! Props to the answerer, but my question is about doing that same thing but also sending a keyword to search in the pdf. I have no idea how to do this, should I set a flag? Any help would be greatly ap...