android

How to set WebView as non-fullscreen?

Hi, I am trying to use a WebView in my Android application. I am creating my webview in code-side (not in XML). My problem is; when I call loadUrl method of webview, the webview goes fullscreen mode. How can I keep the size of the webview for example 200x200 pixels? If there is any other option instead of webview, of course welcome :)...

Apache DefaultHttpClient invocation results in "java.lang.RuntimeException: Stub!"

I'm dipping my toes into Android development. I have a project that will interface with a RESTful resource and I'm trying to figure out how to do a basic GET with params over HTTP. From everything I've read, the consensus seems to be favoring HTTPClient over HttpURLConnection. I've written a wrapper class with a method that takes care o...

Hard-coding button's width in dimension units

I've got the hard-coded layout, consisting of buttons, and need to enlarge some of them. I found Button's method setWidth(int value), accepting width in pixels, but I need to set value in dp. So, how can I set dp value in program code? ...

Why won't onLongPress fire on scrollable text?

I am trying to implement a alert box to pop up when someone holds their finger down on the screen (onLongPress event). The layout contains a TextView inside a LinearLayout, inside a ScrollView. If the text being displayed is short, everything works fine. But if it is so long that a scroll bar is present, the event won't fire at all. How ...

Android: SeekBar Increment Value - How To

My SeekBar (slider) works just fine but, it increments/decrements by one's as I slide my finger but, I want to change the increment value to a constant, such as 5. I tried using slider.incrementProgressBy(5); to do it but, it doesn't work (note: I placed it in different locations, inside and outside the action listener, but it did...

Android API Sample 8 QuickContactsDemo doesn't do anything.

Android API Sample 8 QuickContactsDemo doesn't do anything. Once you key up some contacts you should get something but the program doesn't work, just loads and stops. If there is something else that needs to be added, it should be dropped into the comments. ...

Android: Repetitive Android Activity Workflow. Fire and Forget?

I am working on an application that tries to streamline data entry from a very repetitive process: Enter some details that require full-screen graphics and would be confusing if scrolled Enter some more atomic details Enter yet more atomic details Apply the accumulated data Go back to step 1 I am pretty sure that i can represent this...

how to unzip files programmatically in android ?

I need a small code snippet which unzips a few files from a given .zip file and gives the seperate files according to the format they were in the zipped file. Please post your knowledge and help me out. Thank you so much. ...

Android - Setting bitmap collision detection after rotation by matrix

How do I create code for collision detection on a bitmap rotated by a matrix? canvas.drawBitmap(mAnimation, mainMatrix, null); mainMatrix is derived from a PathMeasure so i do not know the rotation The bitmap is rotated around x=0,y=0 and thus a circle around the centre will not work (or at least be too big) thanks ...

OnListItemClick is never called?

I don't think this problem is caused from my ListActivity subclass. I think it has something to do with with my BaseAdapter subclass: package com.mohit.gtodo; import com.mohit.gtodo.database.TasksDBAdapter; import android.content.Context; import android.database.Cursor; import android.view.LayoutInflater; import android.view.View; imp...

Android Black Glossy Header/Footer View?

In the Gmail app on my HTC Android phone, the headers are glossy black, much like the header on an iPhone. Is there a setting on a view that I can use to create this background look, or is it a graphic they are over laying? ...

Android extremely long text: scrolling ideas?

I have been asked to build an app that lets the user scroll massive amounts of text. The text will be several thousand of pages long. (Each page has and ID so we'll have a navigator too.) Question: What's the best approach to have a lot of text scroll but load on demand more text as needed (up or down). I don't want to load the entire t...

How to send a cookie along with HttpGet in Java

I am trying to send a cookie along with my HttpGet request, but everytime I try I havent been able to successfully send it. I also tried to modify the headers directly, here is my code: DefaultHttpClient httpclient = new DefaultHttpClient(); CookieStore store = new BasicCookieStore(); store.addCookie(Authentication....

How to check something at regular intervals?

Beginner here, I have a simple question. In Android what would be the best what to check for something at regular intervals? Please bear with me, I'll try to explain the best I can -- For example my audio app is very simple, a main activity and a service. The main activity has a UI with two buttons, start and stop audio. I press start...

cannot use a Tablelayout within a widget????

Hello. Here is the xml file of my Android widget: http://pastebin.com/Kqxs5t9E This code is showing me some good results in Eclipse, but as soon as I sent the file to my device and try to add the widget to my homescreen I get this error code and the widget showing: "Problem Loading the Widget": http://pastebin.com/UcvWs1DA So what? ...

List view row Selection

hi i have a simple list view control my queries are: 1) how to set first row selected on start (after fill data in list view) 2) when i navigate by hardware button i got AdapterView.OnItemSelectedListener and color of row background change, but when i click i not get any OnItemSelectedListener and no row selected. How to select row on...

Loading... row at the end of the list - during data download

I have got list that is filled with data from internet. Datas are downloaded in chunks. At the end of the list next portion of data is downloaded and added to the list. I'm detecting list end with help of onScrollListner: @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) ...

custom ContentProvider loading, but not firing onCreate()

Hello, I have 5 Content Providers for my 5 table SQLiteDatabase. They are named: CoreActionProvider CoreMovementProvider CoreRoundsProvider CoreChecksProvider CoreTermsProvider I have stepped through the startup process several times and have confirmed that all 5 Providers are loading. However, only CoreTermsProvider and C...

How can I force a DatePicker to be used for input instead of the keyboard on an HTML text input inside a WebView in Android

I am attempting to learn Android development and have modified a sample app that loads a web page in a WebView. The web page contains a text input. I want to use the Android DatePicker to input a value instead of the keyboard. The code below almost works. The DatePicker is displayed but throws an unknown error when I select a date an...

backgrounds in listview

Hello , i have a listview with a bunch of items in it, each item has its own background, the problem is that if i only have one item in a list, the rest of the "empty" slots of the list is black. I tried applying a background around the listview and also on the view that sorrounds it (relativeView) and i get a strange margin around the w...