android

How to encode XML on Android?

I need to encode an XML document into a format that will pass through an XML parser as a string (i.e. strip tags). I then need to decode it back again and I need to do this on Android. What is the library/class in the Android API that I'm looking for? Thanks ...

EditText's cursor position

User wrote some text in EditText, then touched it somewhere in its field. Cursor position changed. I need to determine changed cursor position, and do some code. How can I do this? ...

Change the Color of Highlighted text in Android.

I'm not sure that this is possible, perhaps someone can set me straight. I have an EditText View in an android application that has white text on a blue background. When the text is selected (via a long press and the edit dialog), I'd like have the highlight be white and change the text color to be black. Annoyingly though there does not...

Concatenating strings to "sets" in Java

Not sure how to word this algorithm question, actually. I have toggle buttons in an android app, each corresponding to a numbered channel. Channels are (1,n) but the toggle button ids are some unknown, unsequential (to the buttons) integer. I need to collect the channel numbers and build a command string. My 1995-based Java skills have g...

How do you add Spinner selection data to a database in Android and then recall it again?

I am currently using Google's Notepad Tutorial as a base, and trying to add spinners in addition to the already existing edittext fields. I want to allow the user to select an item from the spinner and have that option saved in the corresponding database entry. Then when the user opens that record at a later time, the spinner needs to be...

Android image gridview with checkboxes

Hey, I'm trying to make an image gridview which would have checkboxes on each image. So basically the checkbox would hover over the imageview. Is this possible? If it is...how? Thanks ...

Android: Write to /sys/ directory

I'm developing an application that is not intended to be released as a standard app. It'll be run on a single rooted device. I require the ability to write to a file in the /sys/ directory. The file in question is owned by root and has -rw-rw-rw- permissions. I am aware that there may be restrictions on the VM my code runs within that ...

Android popup menu

Hey, I am making a android app. I have a list of items displaying. I am looking to create a popup menu just like the one that pops up when you tap the avatar of a contact in the contact list. I have tried looking threw the android reference but can not find it. has anyone created one of these popup menus? A link to the reference or ...

Android: how to delete internal image file

What i want to do: delete an image file from the private internal storage in my app. I save images in internal storage so they are deleted on app uninstall. I have successfully created and saved: String imageName = System.currentTimeMillis() + ".jpeg"; FileOutputStream fos = openFileOutput(imageName, Context.MODE_PRIVATE); bitmap.comp...

Getting started with android development on eclipse pulsar

I am just starting to get setup for android development. I have installed pulsar and the proper sdks I think. I want to develop for the droid x. I can't find any information on how to create a new project using the installed sdks. Shouldn't there be a project type for android? Nothing like this is showing up. Are there any tutorials fo...

onListItemClick() not working for ListView in Android

The following will not register the Toast upon clicking. In fact, it doesn't even seem to detect a click. The parent class that CustomListTitle extends is ListActivity, so everything should be set, but it's not working. No errors, just no registering a click. package com.mtp; import android.app.Activity; import android.app.ListActivity...

Android apply style to custom TextView

I have a class, TextViewStyled, which extends TextView In my theme XML, how do I apply a style to all my TextViewStyled widgets on Activities with a chosen theme? I have this simple theme, but I want to limit the Black Gold style to TextViewStyled Widgets without specifying the Black Gold in the TextViewStyled style attribute. This is ...

Getting SIM state in GsmServiceStateTracker.java

Hi, How can I get to know whether SIM is present or not in GsmServiceStateTracker.java file? ...

get image from URL using XML parsing

I want edit image from url using xml parsing and that image display in gridview and more image display from device image gallery.how to get image please tell solutions for that ...

How to start an activity in the onPause method?

Hi, I have a webview and when I do some java-script processing on it. I click on a link to play a video, after the video finishes in full screen. I want to return to my webpage in the same state I left it before clicking to play the video. How can I do it? Any snippets? Thanks, Sana. ...

Android: Saving ArrayList of User Defined Objects between onPause and onResume

Hi Guys, I am working on an application where i am saving the state of an application in an ArrayList. Now, to save this state, i tried to use Serialization. But, somewhere in the user defined object, i am using Button, which is not letting me serialize the entire object. I wanted to know, is there any other way of saving this array l...

Do external libraries make apps slower?

I am building an app that scrapes information from web pages. To do that I have chosen to use an html scraper called Jsoup because it's so simple to use. Jsoup is also dependent on Apache Commons Lang libray. (Together they make up a total of 385kB ). So Jsoup will be used to Download the page and parse it. My question is if the use of ...

SimpleCursorTreeAdapter - How to customize Child layout.

Hello, I have been playing around with following android app example. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList2.html I am able to trigger an action when a child is clicked however I cannot seem to figure out how to: 1. Customize the label of each child. 2. Change how each...

Better Implementation of Rotate3dAnimation in Android ViewFlipper

I wanted to create an Android MapActivity with the map in one view, which could be flipped over and then configured in another view, then flipped back over to the map again. The solution I came up with works, but I'm wondering if there's a better way to do this. I copied the Rotate3DAnimation class from the Android ApiDemos, and declar...

FTP prompts for download in browser, can't be found otherwise

I am trying to begin a download using the AndFTP Intent API. The file can't be found. I am using this as a reference: http://www.lysesoft.com/products/andftp/ (bottom of page) I have tried a couple of combinations of Host and remoteFile1 but am bad at path syntax. I get either [filename] not found, or cannot change directory. Also when...