android

Android: UnknownHostException when sending HTTP POST

Hello, What I'd like to do is sending a HTTP POST request to a REST webservice. However it seems as if my applicaion cannot connect to the host. The application throws the following exception when sending the request: 10-19 18:54:05.335: VERBOSE/SD(280): java.net.UnknownHostException: http://www.myhost.com 10-19 18:54:05.335: VERBOSE/S...

Access CSS fonts from Android 'Assets' folder

I'm trying to change the font of web pages loaded in to a Browser app developed for Android. Currently my custom font is hosted in a URL & I access the font from there by injecting a JavaScript to the page to change the style sheet (CSS) font face. Here is the current code: var css = '@font-face {font-family: "dhanika"; src: url(http:/...

Android Web Browser Scaling Works More Effectively for Images than Sprites

Hi All, I'm developing a mobile web application and I have a home screen with a number of icons on it, so I tried to use a sprite to serve all the images in one swoop. I noticed, however, that the iphone4 scaled the images in my sprite fairly well (they looked a little dithered), but on my HTC Evo the sprite rendered images look really...

How can I register my application on Andriod to handle a "type" of QR Code ?

The built-in barcode scanner application on Android (based, I think, on zxing) reads QR Codes and launches that data into an application based on the leading text. For example, "BEGIN:VCAL" might launch a calendar application; "http:" might launch a browser. How can I "register" my application so the OS (or the Barcode application) will...

I have a problem with overlapping views in android appication.

I have a navbar included in a linearlayout with another relativelayout as below. This relative layout forms the whole screen while the navbar is on top. I have added a button in the navbar and a listview which becomesvisible when the button is clicked. The problem is: when the button is clicked I am expecting the list to be displayed on ...

How to put text in a drawable?

I'm trying to create a drawable on the fly to use as a background for a custom linearlayout. It needs to have hash marks and such (no big deal), but also have numbers labeling what the hash marks are (like a ruler). I know I can just create text elements and put them inside the linearlayout and just have the hash marks in the drawable, b...

Proper way to maintain an extended android media database a la MediaStore?

Based on the results of my query in this thread, I've decided that I need to maintain my own database of metadata for the media that I'll be accessing. It seems like MediaStore is a very good start for this, as it will give me a good deal of information and is regularly updated by the MediaScanner. In an ideal world, I would add a few co...

Android AlarmManager set function doesn't work?

Hi, I want to add an alarm, so I used the following code: public void SetAlarm(Alarm alarm) { mTimeTarget = PendingIntent.getBroadcast(mContext, alarm.getRowID(), new Intent(HomeScreen.ACTION_CHECK_TIME_ALARMS), PendingIntent.FLAG_UPDATE_CURRENT); mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, alarm.ge...

jsp does not open up

hello, i have an application where the android device sends data to a server. the server receives the data, processes it and has to open a jsp page. could some one please help. i have used the usual RequestDispatcher rd = request.getRequestDispatcher(request.getContextPath()+"/main.jsp"); rd.forward(request, response); Al...

GLS failed with status 20 -Android Get User Location

locationManager = (LocationManager)context.getSystemService(context.LOCATION_SERVICE); Location location = locationManager.getLastKnownLocation(locationManager.NETWORK_PROVIDER); Geocoder geocoder = new Geocoder(context); List myLocation = null; try { myLocation = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(), ...

ListView and multi-touch gestures

Firstly, I realize this doesn't follow any particular convention. I'm just wondering if it is possible. I'd like to give my users the ability to perform an action on many items in a ListView. My ListView items already contain a checkbox for something different; and adding another checkbox is not an option (it would look ugly?). I was...

My custom ViewGroup doesn't scroll inside a ScrollView

I've extended ViewGroup to achieve something like a FlowLayout. I put my custom ViewGroup into a ScrollView, dynamically add a bunch of content and it doesn't scroll. The content that flows off the screen is not viewable. What am I missing, how can I allow my ViewGroup to be compatible with ScrollView? ...

Android direction sensor

is it possible to know which direction the phone is pointing while looking at the camera preview, or do you have to have the phone flat like a compass. Thanks ...

where should incompatibilities with different android devices be reported?

i developed a home screen widget. the first release was tested on a nexus one, htc evo 4g and motorola droid. worked fine. after release in the android market, someone reported that it didn't work on a samsung fascinate (galaxy s). it turns out there are 2 incompatibilities (bugs?) with the galaxy android implementation. one is with...

Custom ListView and context menu. How to get it?

I have a two layouts files in my app. Also I have Activity extends ListActivity. Every item of this activity looks consider item.xml layout file. I am trying to get context menu when make long presss on item, but I don't see it. In my activity I trying to registerForContextMenu(getListView()) and override two methods @Override pu...

Delpoying a web service as an app for android?

Is it possible to access a webservice through an Android app? So basically a user would be purchasing access to the site by paying for the app? Then deploy rich content to the user through the browser? If so, is it then possible to authenticate who has access to the site from the webserver without the need for signin or signup? ...

Android - nuke the previous app history

Here's scenario. Say I have an app that I was using and navigated from activity to activity so now there's some history there. Then I switched to another app so my first one is on the background. If I return to it I would be able to click "Back" to navigate the history and traverse 1st app steps. Now imagine that I also have a notificati...

How to use combination of Layouts to get widgets at desired position

we are confused with designing interface file for android,we have made user interface with Absolute layout and used "dip" instead of "px" (for different screen size issue) ,but it looks like,Absolute layout has been depreciated,and developer.android, recommends not to use Absolute layout So other option we have is to use 1.Linear layou...

Can i put an icon in the status bar when my application is running? ( PERMANENTLY, also in background mode)

Hi, i want to put just an ICON when my application is running, also in background (home key pressed or something like that) i mean that it's just an icon showing that my application is ON, and it have to be there allways also when my application it's in background mode i can't find any information about how to do this can someone give...

Launch a background web search

Hey Guys, I am trying to launch a websearch using data input from a user. The data is input through TextEdit boxes. Upon submission of the data, i would like my program to: 1) search for a specific webpage based on the user input 2)Find specific elements at the webpage 3) Display the webpage. Here is an example: User Input (in a non ...