android

android maps: How to Long Click a Map?

Hi. How do I long click on a mapview so that a place marker appears at that point on the map? I tried a couple ways without success: 1) Using setOnLongClickListener on the MapvView which never detected the longclicks. 2) My other idea was to extend MapView to override dispatchTouchEvent .. Create a GestureDetector to respond to lon...

About android market to upload an application

When my app upload to android market,Upload assets have a warnig message about this: "This apk requests 1 permissions that users will be warned about android.permission.INTERNET" I check the app of manifest.xml,I'm sure there are manifest.xml to join the line "uses-permission android:name="android.permission.INTERNET" so...Why are th...

[Android] What does it mean when a parent wraps_content and a child fills_parent?

Taken from the Android documentation about LayoutParams: FILL_PARENT, which means the view wants to be as big as its parent (minus padding) WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding) Now, if the parent sets its height to wrap_content, and the child sets its height ...

How to force a Http HEAD command to terminate (for HttpClient and curl) ?

If you run this command: $ curl -XHEAD -i -H "User-Agent: myuseragent" http://www.google.com HTTP/1.1 302 Found ... snip ... Server: gws Content-Length: 222 X-XSS-Protection: 0 you will notice immediately that the curl command hangs. (I am running this in cygwin/VISTA) If you run it against twitter or facebook, curl terminates immed...

How to bring an activity to the forground from inside the activity?

Hi, I am trying to bring an activity to the foreground from inside the activity. I am implementing multiple applications that do not cover the whole screen, so you can see other applications (activities) in the background and even touch them. The activities in the background react on the touch event (e.g. one of it's button is pressed),...

problems with initializing video preview and releasing resources on Android

Hi, I am trying to solve the problem with initializing video preview and releasing resources when the application exits. in onResume() the following methods are executed: holder.addCallback(surfaceCallback); holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); and in onPause() the following method is called: holder.removeCallba...

How to manage multiple versions of same class file for different SDK targets?

This is for an Android application but I'm broadening the question to Java as I don't know how this is usually implemented. Assuming you have a project that targets a specific SDK version. A new release of the SDK is backward incompatible and requires changing three lines in one class. How is this managed in Java without duplicating an...

Implementing DLNA/UPnP (Win7 Play To) on a mobile device

Hey all, For a semester project, I had the idea to implement Windows 7's Play to infrastructure to either use a phone as the end point (the player) or to stream stuff from the phone to a Windows 7 machine. Does anybody have experience working with this API? Is this do able over a couple of weeks (prototype, just proof of concept, not ...

Android: ListView with rounded corners...

I was wondering if there was a way to create a ListView with rounded corners in Android... ...

"JDI thread evaluations" error when debugging java in Eclipse

When I'm debugging my Android applications in Eclipse, I frequently get a "JDI thread evaluations" error when I try to display the value of particular expressions using the Display view. Similarly, it also seems to happen when I set conditions on breakpoints. I'm not 100% sure about this, but the problem seems to occur when I evaluate ...

Android - CheckBox blocks ExpandableListView.OnGroupClickListener

I'm trying to put a checkbox into ExpandableListView. How do I do that? I extend BaseExpandableListAdapter and put the following into getGroupView(): @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View view = convertView == null ? context.getLayoutInflater().i...

Android - Are services shared among processes?

I have an android library which is distributed as a jar file for inclusion in 3rd party applications. Within the jar file is an Android Service. The service is exposed through a facade class in the jar file. Hence 3rd parties do not directly bind to the service, they just use the facade class. I have 2 questions about this architectur...

Equivalent to "overflow" property in LinearLayout on Android SDK?

I've been trying to create a color LinearLayout object (1) within another LinearLayout object (2), while having (1) not display beyond the bounds of (2) - in short, I wish to assign the equivalent of the CSS overflow:hidden property to LinearLayout (2) so that LinearLayout (1) doesn't bleed beyond the edges of (2). <LinearLayout> <!-...

problem in playing mp4 video file in android

hello.. i am trying to play a mp4 video file from remote url in android media player.but i am getting an error code -- Command PLAYER_PREPARE completed with an error or info PVMFErrNoResources error (1, -15) i hv searched for the error code and found that this error is returned if the resource required in processing of a request is n...

Including a background drawable foobars my layout in Android. Ideas why?

If I don't include a background in my root layout then everything renders as I expect: However, if I add JUST ONE LINE adding in a background then the layout goes completely haywire: The relevant bit of the XML layout is: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width ="fill_paren...

upload videos in android

hello.. i am trying upload a video from the application.i am able to upload videos of size lesser than 2 MB but when i am trying to upload videos more 2MB i am getting out of memory error. plz suggest how do i upload videos?? ...

Problem with displaying/updating drawable resources

Hi, I have created a method updateGUI() which include the following method calls: if (settings.isMute()) { muteIcon.setIconImage(R.drawable.ic_volume_off_small); } else { muteIcon.setIconImage(R.drawable.ic_volume_small); } Where setIconImage() is defined the following way: public void setIconImage(int imageF...

animated swap position of two buttons

I am trying to swap the position of two buttons. my swapping code looks as below. private void exchangeButtons(Button btn1, Button btn2) { // Create the animation set AnimationSet exchangeAnimation = new AnimationSet(true); TranslateAnimation translate = new TranslateAnimation( Animation.RELATIVE_TO_SELF, btn2.getLeft()...

How to inflate core/res/res/layout/simple_dropdown_item_2line.xml

There is this xml file under frameworks/base. /frameworks/base/core/res/res/layout/simple_dropdown_item_2line.xml How can I inflate that in my own android application? Thank you. ...

Best Android 2.0 development book?

I'm looking for a single book source for Android 2.0 development. While I may be ok with a general Android development book, a book which covers 2.0 features is ideal. What is the best Android 2.0 book out there, or upcoming? ...