android

How to put another button in android quick search box?

Hello, i'm using android qsb feature in my app. Qhen user click len button on hes keyboard, i open quick search box with one input box and one button. I want to know if i can add another button in qsb. I think it is possible, Google has added search by voice button in qsb. Thanks. ...

Android CameraPreview sample in API Demos - preview is incorrect size after long press on Home on Motorola Droid

I am testing the Android CameraPreview demo on a Motorola Droid running 2.1-update1. If, while the activity is running, I press Home and then do a long press on Home to return to it, the preview image is the wrong size. Opening the physical keyboard corrects the issue - I'm guessing that a configurationChange is fired, the surface gets...

Problem with SimpleCursorAdapter

Hi guys. I'm trying to create a list activity that uses a SimpleCursorAdapter, but it just won't work. I know I'm getting the cursor correctly because when I have it print out to text all the values are there and I know there's nothing wrong with the SimpleCursorAdapter class because when I used it with the Image Content Provider it disp...

Stuck... need help.. Listview w/ Array Adapter

Ok, so I have this application that takes a adress strings (from values/xml) and parses it your current position) retuning a name, address and distance away. This is then picked up by an arrayadapter and put up on a listview. I cannot for the life of me get the list view to accept an onitemclick to start another activity, where I can ...

android sqlite insert problem with error code 19

Hi everybody! when I'm trying to run the ContentValues cv = new ContentValues(); cv.put(table_LocalSettings_Unit, input); mDb.insert(table_LocalSettings, "", cv); I got the following error: Error inserting unit = 0; SqliteConstraintException: error code 19 constraint failed. What should be the problem ? The table...

draw original image size using android

i am writing pgm for zoom in and zoom out in imageview and i set canvas bound in some range so image was big,i want to display actual image size in canvas for zoom this my code.. protected void onDraw(Canvas canvas) { super.onDraw(canvas); //this line i want to edit code for get original image size image.setBounds((getWidt...

How to open port in Android?

How can I open a specific port in android? I have a server socket but the connection is rejected because the port is closed. try { ServerSocket server = new ServerSocket(2021); Socket client = server.accept(); } catch (Exception e) { // TODO Auto-generated catch block a = false; e.printStackTrace(); } ...

Opening Sqlite Db on command prompt

Friend , I working on Sqlite DB,i want to open and view or create database through adb shell command.. in command prompt i'm doing this above steps, 1. cd C:\android-sdk_r04-windows\android-sdk-windows\tools> 2.adb shell how can i go for sqlite> after step2 and i'm getting an $ after step 2 and then how can move further process. suppo...

Using ImageGallery to display images from the SD card?

Hey guys, How would I use ImageGallery to display images I have saved in a particular location on the sd card? ...

android: where to put custom data

In a typical Android project you have the res/drawable directories where you can put images but i have some special custom binary files. where do I usually put them and can i access them via the R-class then? ...

adb forward remote port to local machine

Hi, This is a query regarding the usage of adb on android. Is there a way to forward the remote port i.e. port on the android device/emulator to the local machine to which the device is connected? $ adb forward tcp:port1 tcp:port2 # forwards the local port port1 on the machine to port2 on the device. Thanks in advance! ...

TextView content not wrapping or scrolling

I have a simple TextView that displays some text that I've scraped of the web. Despite the fact that the text I want to display is much longer than the width of the screen, it neither wraps nor gives me a scroll bar. It just stops. My layout is configured as follows: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android...

Customise the Spinner in Android

Kindly provide the Java/code to customise Spinner. e.g. I want to change the colour of the background of the Spinner , change the text size of the data to be displayed in the Spinner, change the down arrow image at the end of the Spinner. Warm Regards, Chiranjib ...

Customize setbound value for viewing original image size

image.setBounds((getWidth()/2)-zoomControler, (getHeight()/2)-zoomControler, (getWidth()/2)+zoomControler, (getHeight()/2)+zoomControler); i want to set bounds value for original image size,how can i set the value for display original image size ...

How to set margin of ImageView using code, not xml

Hi, I want to add an unknown number of ImageView views to my layout with margin. In xml, I can use layout_margin like this: <ImageView android:layout_margin="5dip" android:src="@drawable/image" /> There is ImageView.setPadding(), but no ImageView.setMargin(). I think it's along the lines of ImageView.setLayoutParams(LayoutParams), but...

ListViews with multiple item layouts

I have a ListView on my ListActivity and I'd like the rows of the ListView to be 1 of 3 different layouts. The first item in my list is always going to use layout A, the second item in my list is always going to use layout B, and all subsequent items are going to use layout C. Here is my getView function: @Override public View getView...

Weird shadow behavior for android MapView

I am putting several markers on a MapView by subclassing an ItemizedOverlay. The hitch is that the marker I am passing to the ItemizedOverlay is a custom Drawable. That is to say, I've subclassed "Drawable" and I have overwritten the draw() method. The point of this was to add a color filter to the Drawable, and add custom text: publ...

How to make a LinearLayout scrollable

Hi, After I start the activity I am unable to scroll down to see other buttons and options in the xml defined below. Does anyone know how to make this scrollable? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width...

Apply a Frame Animation to a Toast View

Is it possible to play a frame animation on a Toast View? Lines 3-5 in the code below are what usually works for me if I want to play a frame animation on a View. Unfortunately when I try to apply that view to a toast object, it is not animating when the toast is shown. Does anyone know if it is possible to have a frame animation play...

Android converting a JPEG from a Nexus one to a MJPEG stream

Hi, I want to send video from the phone (Nexus one) to other devices on the network. I know Android supports video encoders/decoders. But for now the other devices can only accept Base64 encoded JPEG images. Has anyone done something like this or can provide pointers to if and how it can be done ? Thanks. ...