android

Trouble refering to a custom View in a layout XML

I am trying to refer to a custom View in the helloWorld XML layout but I get the following exception: Error inflating class acme.my.MyTextView. However, I am able to instantiate the view and add it to the main content view manually. The custom View is built from it's own XML layout. How do I get this to work? public class MyTextView...

How to Improve Performance of the Android Emulator

I'm getting started with Android development, but the emulator performance on my machine leaves much to be desired. In all fairness, my machine is not a powerhouse by any stretch of the imagination. Short of upgrading my hardware or spending $$$, are there any good tips for improving Android emulator performance? ...

Android column '_id' does not exist?

I'm having trouble with something that works in the Notepad example. Here's the code from the NotepadCodeLab/Notepadv1Solution: String[] from = new String[] { NotesDbAdapter.KEY_TITLE }; int[] to = new int[] { R.id.text1 }; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to); This code seems to w...

onOptionsitemSelected(MenuItem) of Type Appname(XXX) must override a superclass method

Hi All, I am try'g to create an Simple application in android,In one of my module,i have to call the options menu that appears underneath the screen,when i click the menu button in the adroid emulator, Since i have to invoke an new activity,when one of my menuitem in optionmenu is tapped, i put @Override before the method onOptionsSel...

Android Number Picker Dialog

Does anyone have any dialogs that will allow a user to pick a number within a certain range? It seems like this would be a fairly common need, but I can't find a common dialog for it and I'd rather not have to spend the time creating my own. Any help? ...

display the elments in grid view in only one row

Hi, I want to display the grid view elements in only one row that means i want horizontal scrolling in grid view.Each time i want to display only 5 elements only in one row.For this give me some suggestions.Thanks in advance. below is the my layout code <?xml version="1.0" encoding="utf-8"?> android:id="@+id/TextViewImageName" ...

overriding dispatchDraw(Canvas) in subclass of SurfaceView

What exactly does dispatchDraw(Canvas) method do? This is what the documentation says: protected void dispatchDraw (Canvas canvas) Since: API Level 1 Called by draw to draw the child views. This may be overridden by derived classes to gain control just before its children are drawn (but after its own view has been drawn). Parameters c...

Anyone with any experience in internet fax services? (looking to build a .Net app that sends fax)

Looking to build a smartphone (iPhone/Android/Blackberry) web app that accesses a .Net app, which in turn will fax a photo you've taken with your smartphone. Has anyone used any 3rd-party internet fax services like this? Any recommendations? ...

Android layout - Screen wont move up to allow input in EditText at the bottom

Hopefully this is just something easy since I'm still wet behind the ears with programming for android. My issue is that i have a couple EditText boxes at the bottom of my layout. When in the emulator they work as expected, you touch the edittext and the screen scrolls up so you can see the content. However when i try it on my droid inc ...

How to redirect my log output from logcat to the SD-Card on an android device?

I'm trying to redirect the log of my app to the sdcard file. But i failed to do so. I'm trying something like this. String cmd= "logcat -v time ActivityManager:W myapp:D *:* >\""+file.getAbsolutePath()+"\""; Runtime.getRuntime().exec(cmd); I tried the -f option also but it is not working either. ...

how to move to specific ativity after pressing back in android key pad (android)

hi want to specify in code to move to specific activity after pressing back button on android key pad how i can accomplish this, frnds help me now i got the solution with the help of our friends hi got the solutin to my prob onBackPressed() works after 1.6 version for previous versions we need use public boolean onKeyDown(int keyCo...

Android HorizontalScrollView as a Preference?

Hi everyone, I've been having a tough time working with HorizontalScrollView's as a custom Preference. My overall goal is to make a scrollable series of dynamically included images that the user can chose. The chosen image will be used later, and thus needs to be a Preference (or at least that is how I think it should be implemented). Ha...

View State lost with click...

...

In android, how do i save an image in the internal storage?

Im making an application which requires me to store a byte array and then retrieve it.. while storing it, i used the "compress" method, storing it as a jpeg.. this isnt working.. An alternative method is possible.. ...

Bluetooth - Is there any way through which an applicantion can set the PIN to be used for a bluetooth connection

Hi All, I wanted to build an application related to Bluetooth in Android . Is there any way by which I can set the PIN from my application in Android other than using system dialog box to enter PIN which pops out . I checked for API's given by Android for bluetooth, but I could not locate any API for setting keys for bluetooth as provid...

using dispatchDraw(Canvas) to obtain subsection of video preview

The following is the overriden dispatchDraw in a subclass of SurfaceView. I'm trying to change the parameters of the Surface(getting only a subsection of the video preview. @Override public void dispatchDraw (Canvas canvas) { Log.d(TAG,"**************inside dispatchDraw************"); int VIEW_WIDTH = canvas.ge...

com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader to Json - perplexed with this problem

Hi group, I am trying to parse a json object using gson in Android application ,the test passed quite gracefully in emulator ,while i used the actual device ,the problems started I am getting the exception as follows .....: com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json ......: p...

Invalid keystore with Google Maps API

I want to use the Google Maps API in my Project. I signed up and got the API key also. When I run my application now I'm getting an error "Error generating final archive: Invalid keystore" I m really fed up. It is very difficult to use Maps in an application. Do you know what the problem is in this case? ...

Register not able to be done due to error checking in the if..else statement

I got problem with register. I use an if-else statement to check whether the user left any blank. If there is any blank, an error message will appear. The problem is, even with no blanks, all filled up, the error message still appears and thus prevents user from registering. I can't find any error. Please help me spot my error. packag...

Error with spinner

There is an error when i run my android program. My Booking.java package one.two; import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.widget.SimpleCursorAdapter; import android.widget.Spinner; public class Booking extends ListActivity { private DBAdapter db; /** Called w...