android

Got 0 when using HttpURLConnection.getResponseCode ()

Hi, I`m using the class HttpURLConnection this way: HttpURLConnection con=(HttpURLConnection) servlet.openConnection(); int conResponseCode = con.getResponseCode(); Sometimes I`m getting conResponseCode as 0. I tried to look in the net, and couldnt find what it means? any idea why it occours? and what it states for? Thanks, ray. ...

Set Alarms to Specific Date and Time in Android

Hi friends, Please kindly have a look at this. I am trying to set an alarm for a specific time and date. It does not seem to be working and i don't really know why. Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(System.currentTimeMillis()); cal.set(Calendar.YEAR, mYear); cal.set(Cale...

Android: Logging on to SSH server for internet access

Hi guys, At my campus, to get internet connection, I need to log on to a SSH server like they write: ...you must manually log in to the firewall server, by establishing a pseudo-tty-less ssh connection to it. The following command can be used on most systems: ssh -T -l [username] [server-URL] I must be logged on to the server for a...

ListView selection highlights multiple items in the list when scrolling

I have a custom adapter for a list in my ListActivity in my Android app. I'm dynamically setting the background color of the current item that was clicked because I want to set the marquee of the TextView in the custom list item. This is how I'm doing this: @Override protected void onListItemClick(ListView l, View v, int position, long ...

android:screenOrientation="landscape" Scroll not working

how to scroll through activity when activity is in landscape mode, Scenario: my textview has around thousand words and few buttons,how to apply scroll to this when activity is in landscape mode ...

how to solve this exception Illegal character in path?

Hi Friends, i am displaying images from url using xml parsing,some images are displaying very well,some time i got exception like Illegal character in path at index 113: http://www.theblacksheeponline.com/party_img/thumbspps/12390867930_15951_186997180114_709920114_4296270_6115611_n[1].jpg How can i solve this problem,anybody know,...

How can i delete image file in external storage after email sent?

Hi Friends, i am storing image in External storage using MediaStore,and send email with attach that image,image saved and sent email with attachment is working fine,i want to delete that image in external storage after mail sent.anybody knows,please give sample code for me.. Thanks All, ...

How to implement wheel widget like in iPhone?

I would like to implement a time settings wheel widget like the one iPhone has (http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/art/ui_datetimepicker.jpg). Should I use GlSurfaceView or just extend View? Should I make it as a compound View (it would consist of several Views) or draw everything ...

Android: Manage contacts with lookup key

Hi everybody, I'm currently writing a application that allows to save drafts (using android version >= 2.0). Each draft is connected to a contact via the ContactsContract.Contacts.LOOKUP_KEY. My problem is that if I change the name of my contact the lookup key changes also. Is that the way this works? So for what do I need a lookup key...

Cant get helloWorld Loaded on AVD

Hi My Helloworld tutorial sample builds and runs just fine, except it doesn't show the text (i.e. loads apps). The only thing I see is that Emulator (Target 2.2 API level 8) comes up with just the "Android" in it. and then the emulator shows up a locked up screen in a while. Here is output from the console [2010-09-20 10:36:55 - HelloA...

android startActivityForResult is killing a thread within the parent activity

Hi, I have an activity which has a thread and a view in it...they're suspiciously similar to LunarLander. To show an in-game menu, i'm calling the startActivityForResult for a different activity which has a number of buttons on it...this is then returning the button type pressed to the parent activity. This is fine except when I carry on...

How to make a 2-dimension image gallery with both horizontal and vertical scrolling?

Hi, I'm new to Android and I want to make an image gallery where each column is a category, and users can scroll both vertically and horizontally. I found a useful post about how to display list of images here. I'm wondering if it's possible to nest lists of image inside of a gallery view? ...

Running Dev Tools on Motorola Droid

Hi all, I'm trying to get some resource usage (processor, etc) for an application I am developing, and the best way seems to be putting the 'Dev Tools' program on my phone. I've tried as outlined on the Android Developer site , but every time I try to run it, the program crashes. The error seems to come from an invalid permission. F...

How to make the SAX Parser wait for a file to finish downloading before it is parsed?

I am having a problem where my XML files are slow to load and don't finish downloading before they start to be parsed which throws an xml not well formatted exception from my parser showing that the file downloaded incompletely. The complete error from logcat is "ERROR/Error(323): errororg.apache.harmony.xml.ExpatParser$ParseException: ...

compiling synamic arm code

I'm building some common gnu/linux console utilities for my Android phone but so far I have only been able to build them statically, with quite a size penalty. Can someone walk me through the steps for synamic compiles using shared libraries? Here's the script(s) I'm using for configuration: ./configure --host=arm-none-linux-gnueabi \...

How to get data from server and update the database with it ?

I am implementing an android application and i can't figure out how to solve this problem : When user clicks to the update button , i want to connect to the my server and check if there is any update on the data , if there is , i want to get data from server and update the database.Should i use xml structure to check and get updates from...

Music does not play after clicking back key and returning to activity in Android

Hi, I am trying to play Audio using videoView using MediaController. The Audio is playing well, when I click back key the controls returns to previous state. But when I select activity again from launch screen, activity appears but music doesnot play. Can anyone help me in sorting out this issue? The code is as follows: public void on...

How does my android activity knows when the device changes in orientation

Hi, Can you please tell me how does my android activity know (is there a callback) when there is a change in screen orientation? Thank you. ...

Possible to send an image to my Servlet as a ByteBuffer?

I am attempting to have my android phone connect to my servlet and send it a certain image. The way I figured I would do this, is to use the copyPixelsToBuffer() function and then attempt to send this to the servlet through some output stream(similar to how I would do it in a normal stand alone java application). Will this way work? If s...

MediaController appears only after tapping in Android

Hi, I am writing an Android App where I am playing video using VideoView,but the mediaController appears only after tapping the screen.Is this correct procedure ? If not how can we make it to appear without tapping on the screen. Thanks in Advance, ...