android

Consuming WCF Restful Service on Android

I am trying to comsume a self-hosted WCF service which simply returns a String in JSON format. It takes a very long time around 2-3 minutes to get the response on Android Device, where as on any other computer it works fine. Could anyone help me on this? Thanks in Advance. Below is my code to access the service. try{ HttpClient http...

Problem in a ScrollView with Buttons inside, no response until second click on any button inside

Hello. I've been a couple of days trying to solve this thing but I can'f figure it out. The problem is, simple activity, with simple layout, ScrollView -> LinearLayout -> and a lot of buttons inside the layout (within the scroll content). Everything works just fine but one tricky thing. When I click a button let's say at the top of the s...

Drawing multiple shapes with ShapeDrawable in xml with Android

Hi, I am currently drawing a number of circles on a canvas in a custom view in code. the circles are static and do not change. I would like to draw them using a ShapeDrawable in xml to help clean up my code. I will have a number of different drawables which the user can select and therefore I don't want to do this in code. having 3 or 4...

Notification: pass data

I'm trying to pass data from notification to activity: btnShedule.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Intent notificationIntent = n...

Android: Image gallery share to app

I've got an app that accepts images from the image gallery (via share menu). My app starts, and I do this: Bundle bundle = getIntent().getExtras(); Object obj = bundle.get("android.intent.extra.STREAM"); While debugging, Eclipse is reporting the object obj is of type 'Uri@StringUri' (???) and inside it somewhere is the string ...

AlertDialog setSingleChoice without radio buttons

I am using an alertDialog to display data similar to a spinner. Is there a way to move the active selection (like in setSingleChoice) using setItems ? I want the displayed list to look like a spinner, without the radio buttons. ...

How to create ExpandableListView in Android using java code ?

Hello all.I am new to android.I need to create ExpandableListView by using java code(without using xml design).This is my very first task.Can anyone help me?Thanks in Advance !!! ...

Posting short messages to twitter and long messages to gmail using ACTION_SEND

Using ACTION_SEND it's possible to post messages to various sharing services such as gmail, facebook, twitter, etc. Most services have reasonably long message lengths, but twitter in particular is very short (140 characters). Not knowing in advance which service a user is going to select once the Intent.createChooser() dialog appears, ...

menu XML with MenuInflater

I made an XML file under my newly created res/menu folder. Menu.xml contains my menu definition for use with MenuInflater. The entire XML file looks like this: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"&gt; <item android:id="@+id/settings" android:title="@string/set...

Android HelloWorld IllegalArgumentException

I have seen this question answered but the answers do not apply to me. I am a beginner to Android and I am trying to run HelloWorld with the Eclipse Plug-in that I have downloaded Api's 7 (2.1) and 8 (2.2) and have created a virtual devices for each version. I am running eclipse in xp with 1.6.0_22-b04 (32bit) no 64 bit jre installed on...

My Android app keeps giving me a Leak Found error

Hi guys, I am working on an Android app but I keep getting a Leak Found error. Here's the Call Stack: 11-01 11:26:47.087: ERROR/Database(7317): Leak found 11-01 11:26:47.087: ERROR/Database(7317): java.lang.IllegalStateException: /data/data/com.noshufou.android.su/databases/permissions.sqlite SQLiteDatabase created and never closed 11...

Android: I am using AChartEngine library for graphs, but not able to integrate achartengine's graph view with android xml? Need help..!!

My application requires graph library and I am using achartengine graph library. My app requires graph to be only 50% of the screen and other part is used to display some other information. So is it possible have xml resource file for achartengine's graph APIs? If yes kindly let me know how to do it. I tried to find example but did n...

How to retrieve height of application header?

Hi Is there a way to retrieve the height (in pixels) taken by the application title and the top bar (the one containing the clock, signal information etc...) Thanks ...

mkdirs returns false for directory on sd card while the parent directory is writable

At some points while running my android application, I need to create a directory on the sd card, for a small number of users this fails and I can't figure out the reason for it... (I've found similar problems caused by the WRITE_EXTERNAL_STORAGE permission missing, it's there and it works for almost all users so I don't think this is r...

Reusing Android Lock Pattern

I am writing a application and it should be protected with a password. Instead of building a new one, Is it possible to use the Android's Pattern lock screen from application with different patterns? ...

Android: AppWidget with custom view not working

I am creating a appwidget that consists of a single custom view called Foo. xml/widget.xml: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="294dp" android:minHeight="72dp" android:updatePeriodMillis="0" android:initialLayout="@layout/widget_layout"> </appwidget-provider> layout/wi...

Windows Media Services streaming (using RSTP or HTTP) to Android

Is it possible to stream video to an Android device by using Windows Media Services? Which protocol should I use between RTSP and HTTP? Actually, I have a video file (MP4 format) at a server and I want to stream video files to an Andriod device. ...

Content Service Crash

I get weird exception: 10-31 09:09:51.308: ERROR/ContentService(59): Content Service Crash 10-31 09:09:51.308: ERROR/ContentService(59): java.lang.NullPointerException 10-31 09:09:51.308: ERROR/ContentService(59): at android.content.ContentService$ObserverNode.collectObserversLocked(ContentService.java:620) 10-31 09:09:51.308: ERROR...

Android: How to check does shared preferences exist, and how to delete them

To check does preferences exist I tried this way, but it shows null every time(maybe because I saved preferences in different view): String def = null; String test = getPreferences(MODE_PRIVATE).getString(PREF_GAME,def); if(test == null) Log.v("main", "no saved data"); To delete preferences I tried editor.clear(), but it does't delet...

How to apply context menu on rows of tablelayout dynamically from program

Dear friends, I have created one music app. It contains some collection of albums, when we click on a particular album the songs in that album will be loaded in to anther activity. These songs are displayed as rows of table layout and these rows are dynamically changed based on the songs.I have registered context menu for t...