android

how to access camera.java in on cick event?

hi , i am making a app which takes photo on button click i have camera.java which operates camera and takes photo how to i call it on the below event? public void onClick(DialogInterface arg0, int arg1) { setContentView(R.layout.startcamera); } Camera .java package neuro.com; import java.io.FileNotFoun...

How to get an item's position from item's ID in android spinner?

Hi! I need to get an item's position in spinner knowing it's ID. I've tried to do it with Spinner and SpinnerAdapter classes but there are no corresponding methods there. Thanks, Aleksander ...

What can a company possibly gain by making Android phones hard to root?

As someone who recently got a HTC Hero, I had to jump through several hoops to get root access on the phone to install custom firmware. Now, Android is open-source and fairly easy to build and hack on an emulator. It seems to be against the spirit of open-source to lock down a phone so you can't hack the phone itself. Now, often, there...

Why is MenuItem.AdapterContextMenuInfo null when my list view has a custom adapter?

My question: Before I go and use an OnLongClickListener, is there a better way to pass the "what was clicked to create this context menu" information when your list view has a custom adapter? Here are some details: Normally, my code can just do something like this: public boolean onContextItemSelected(MenuItem item) { AdapterConte...

Send information from PHP to Java

I want to send some information from PHP to Java. Why? Because I have a database on my server, and I get information from my database using PHP scripts. Now I want to send that information to my client in Java. How can I do that? I send information from Java to PHP by POST, and it works well, but I don't know how can I do the reverse. ...

How to enforce webkit to use system APN proxy in Android?

I'm trying to force Webkit to use proxy definde in APN. My proxy configuration: APN: wap PROXY: 192.168.6.102 PORT: 8080 USER: wap PASSWORD: wap` Currently all connections made by Webkit are blocked on firewall. Is there way to use proxy from phone profile? ...

Translate a picture to text on Android?

I know that google goggles will translate a picture to text. What I want to do is allow the user to take a picture (no problem), translate that picture to text(?) and then do some processing on the text (no problem). Is there any API on android that allows this? or is there any way to programtically communicate with google goggles? I wo...

ShouldNotReachhere classFileParser ANDROID

Any idea how to fix this issue? I'm using Eclipse and it seems to occur even when I create a new android project. :( # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (classFileParser.cpp:3174), pid=3944, tid=3256 # Error: ShouldNotReachHere() # # JRE version: 6.0_18-b07 ...

How do I produce a clean listing of APIs for Android SDK?

Kinda like in the format of a class-dump result but in Java, I already have the Android.jar file and I would like to dump a clean listing of classes and methods for each .class file. How do I do this? p.s. HTML documents seem too messy and hard to parse. ...

Using volume buttons while in sleep mode ( music player style )

Hi, I need to use volume buttons in my application while sleep mode is active( black screen, locked). I am using onDispachKeyEvent to capture volume buttons and it works perfectly while in normal state. In music player if you close the screen, you can still change volume. Any idea how is done ? Thanks ...

android service question

Hello, I have a class, MyService. This is my Android service. I wanna generate two random numbers, and this service should return the sum of these numbers. How can i do that? So , i should generate the numbers in public void onStart(Intent intent, int startid) { //Toast.makeText(this, "My Service Started", Toast.LENGTH_LONG).show()...

Open new Screen in Android?

Hi I am new to android. In my application if user selects the button in the alertDialog I need to open a new screen and I have to display some message on that screen. How to open a new screen? ...

Connecting Android XML and Code

I'm new to android and have gotten used to doing all my previous UI in code. I can understand the simple examples, but I'm trying something more complex and have no idea how to do it in code and XML. I'm trying to use the google map api and draw text on the map at a specified spot. I have succeeded in doing so by extending overlay and...

Can Somebody Explain this java code

Hi, I'm just starting out on android and my java is verry rusty. I can't remember ever seeing a function nested in another function like this before. Could somebody explain to me exactly what final does and explain why you would nest a function in another like this? private final Handler handler = new Handler() { @Override ...

Android: Shut down / loss of bluetooth connection or file receive -> Do something

Hi guys, I want to write an App that monitors my paired bluetooth connection in the following way: If a file comes from a paired source it should be stored. If no file was passed and the bluetooth connection breaks down, my app shall store a dummy file. Storing a file works great, my main issue is how to run this whole thing without h...

Android: onListItemClick not opening up the .xml file

Hi, public void onListItemClick(ListView l, View v, int position, long id) { if(position == 0){ setContentView(R.layout.cuisine); } } I have an array of Strings and i'm using the above method to try and open up a new xml file called 'cuisine' when it is clicked. but it keeps failing! Have I done this right, or what a...

How to test a call to setContentView?

How do I write a unit test to determine that the layout used in setContentView(int layoutId) has been called and corresponds to the proper layout for a given activity? ...

how to extract to, subject etc fron email in android emulator?

Hi, I want to extract "To" and "Subject" from email clent which is already configured in android emulator. so, is any api to extract or to get all email attributes? Thanx in advance, ...

Is there a way to add a badge to an application icon in Android?

On the iPhone, you can add a numbered badge to the application icon. On BlackBerry, I've successfully painted an image onto the application's icon while in the program. I want to do this for Android as well. I don't want to use the notification bar, as it's not something that needs to be notified instantly. Instead, I just want the user ...

Android NDK keeps looking for "g/David/..."

I installed the latest version of the Android NDK (r4) on Windows, plus a fresh installation of cygwin with the required packages, latest Android SDK, Eclipse + Android plugins. Whenever I try to build any of the JNI code from cygwin (Be it the samples from the NDK, or a custom project), I'm getting: $ make APP=demo Android NDK: Buildi...