android

Android: Crop an Image after Taking it With Camera with a Fixed Aspect Ratio

Hi all, I'm trying to crop an image after taking it, and my code is as follows: private void doTakePhotoAction() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); intent.putExtra("crop", "true"); ...

BitmapDrawable with unexpected size in Android 2.0.1 WVGA854

I want to display a 480x320 JPEG file stored in the SD card in Android 2.0.1 with WVGA854 skin and 240 lcd density (Motorola Droid). However, when I create a BitmapDrawable through Drawable.createFromPath(), the resulting BitmapDrawable has the following values: mBitmapWidth = 320 mBitmapHeight = 213 mTargetDensity = 160 The manife...

Cannot get httpResponse content

Hello, I didn'y manage to query a web service from android emulator (previously I had a UnresolvedHostException but this is ok). Now that I can go any further, I do not have anything returned in the HttpResponse's Entity (length is -1). String url = serverUrl + resource; Log.d(TAG, "GET: " + url); HttpClient client = new DefaultHttpClie...

Android XML Parsing omitting "&"

Hi again friends... The problem again is that though i have succesfully implemented a SAX parser in my code... It is behaving wierdly. It jus skips the enteries after the & and goes to the next entry. Just wanted to know whether this is the typical working of SAX parser or m i implementing it wrongly??? I have implemented org.xml.sax.Co...

How to resize a android webview after adding data in it

In a layout (linear, vertical) hierarchy I've got several view and one of them is a WebView. They all have same parameters: android:layout_width="fill_parent" android:layout_height="wrap_content" For all views the spacing between element is correctly handled but for the Webview there is a lot of spaces after the displayed text inside....

How to remove label from MapView ?

Hi guys. I am trying to make only satellite view without label. How to do it ? Thanks. ...

Slider on my PreferenceScreen

Hi, I want my preference menu to have something to change the duration of a vibration. There is not an slider tag for prefs.xml, so which is the best way to do this? Thanks for reading. ...

ListActivity not scrolling

Hi guys... I have a list Activity 4 which i have extended the BaseAdapter and the getview looks like this... public View getView(int position, View convertView, ViewGroup parent) { View row=null; for(int i=0;i<10;) { row = convertView; if(row==null) { ...

How to get text from EditText?

The question is quite simple. But I want to know where exactly do we make our references to the gui elements? As in which is the best place to define: final EditText edit = (EditText) findViewById(R.id.text_xyz); edit.getText.tostring(); When I try it doing inside the default oncreate() I get null values. So for best practice, do u ...

custom Dialog by extends dialog or alertDialog

hello,I want to make a custom Dialog,because i donot like it"s style,i want get a rounded rectangle rather than rectangle . i know to implement it by theme in Manifest.xml . for example :the code at activity write: android:theme="@style/Theme.CustomDialog Theme.CustomDialog.xml @drawable/filled_box true filled_box.xm...

Efficient mapping of Strings to ints in Android

Currently I'm using a HashMap to map the strings to int and the int values need to be frequently accessed. I'm looking for a better way to do this if possible with minimal object creation, and preferable being able to store the values as primitive ints without wrapping them with the Integer class. (Basically, the reverse of the SparseArr...

Android - create a service that runs once a day

I'd like to create a service for Android that performs an operation once a day at a given time. What's an efficient way to accomplish this - I want to make sure I'm not draining the device battery since this service is idle 99% of the time. ...

Autostart Android application after installation complete

Hi All, I know how to autostart after boot with the BOOT_COMPLETED intent action, but I didn't find how to autostart an application just after it has been installed on the device. For my application I would like to set an alarm after the install, I looked at the PACKAGE_ADDED intent action but it says that the newly installed package d...

Enable Android bluetooth from documentation

I am trying to get my Activity to enable Bluetooth with the Android 2.0.1 SDK, I am using some code straight from the documentation here: http://developer.android.com/guide/topics/wireless/bluetooth.html Which is: if (!mBluetoothAdapter.isEnabled()) { Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); s...

OpenGL key frame animation - the best approach

Hi, I'm trying to animate object. I use keyframe animation: I have two vertex buffers (two frames) with vertices of my object - first buffer is for object start state and second for end state. To transform the object I simply use linear interpolation. To make it more clear, please take a look at the code snippet: FloatBuffer vertexBu...

Display a simple text label / descrption bubble when user taps on a OverlayItem in MapView

I would like to further annotate the custom markers I have placed on a MapView (using ItemizedOverlay) by displaying a simple text label that appears for a particular item when the onTap event is fired. This is a trivial exercise in the Google Maps JavaScript API and in MapKit on iPhone, but it is not obvious to me what the best or eas...

Question about gridview and using array

Hello everyone. First, im new to developing for android and this forum. my question is this: i was looking at the "Hello world view: gridview" example and was wondering, how do i load all my images dynamically. for example in the ImageAdapter.java file, at the end there is: private Integer[] mThumbIds = { R.drawable.sample_2...

How to use SMS content provider? Where are the docs?

Hi, I'd like to be able to read the system's SMS content provider. Basically I wanted to make an SMS messaging app, but it would only be useful if I could see past threads etc. It seems like there's a content provider for this, but I can't find documentation for it - anyone know where that is? Thanks -------- edit ----------- Ok I f...

Android - Calling Activity from widget

I currently have widget for my app Hire*A*Droid bundled with the main application. I would like to unbundle the widget and release it as a separate offering. However - the widget is relying on Activities from the main app so I need to navigate between these two mainly calling particular Activity of the main app from the widget. So the ba...

Android Full Text Search

Does Android come with a way to do Full Text Search? I know is it not even possible to search contacts by the notes field, being Google the search company, but I would be disappointed if there is no API for that. ...