android

Android: Is decreasing size of .png files have some effect to resulted Bitmap in memory

I'm writing game with a large amount of .png pictures. All worked fine. Than I added new activity with WebView and got memory shortage. After that I made some experiment - replace game .png images with ones that just fully filled with some color. As result memory shortage had gone. But I suppose that Bitmap internally hold each pixel se...

Android onTrackballEvent and Click

Hi Everyone, I want to capture onClick events for the trackball on a HTC Hero. This event is firing and I can get the direction of motion of the trackball: @Override public boolean onTrackballEvent(MotionEvent event) { } How do I find out if the event was a click event? ...

Socket Exception Handling on the Android Platform

Greetings all, I am developing an app that communicates TCP/IP with a hardware controller(server). I have no problems connecting to the server through my ConnectionService(), sending/receiving messages (correct IP and Port) when I call for a new Socket(). However, when I enter a wrong IP or Port the app should present the user with a di...

Don't see "Hello,Android" on emulator

I created Hello,Android application with TextView, not xml. When I run it I don't see "Hello,Android", only wallpaper. Any ideas, what is wrong? ...

Big Nerd Ranch's Android Bootcamp - worth it?

At work, I've been told that I must, before the end of the year, get a certification. The shop is Microsoft heavy, and I'm not. That's why I was excited when I suggested something in support of Android development, and they agreed. Before I go any further, I should say that I don't know what I think about the whole certification quest...

Drag and drop + custom drawing in Android

I am working on something that needed custom drag-and-drop functionality, so I have been subclassing View, doing a bunch of math in response to touch events, and then rendering everything manually through code on the canvas in onDraw. Now, the more functionality I add, the more the code is growing out of control and I find myself writin...

How do we get Polygon Antialiasing in OpenGL ES on Android 1.5?

Based on my reading of Ch. 6 in the Red Book, changing the things that need to be changed for ES, I thought the following code should have done it: gl.glEnable(GL10.GL_POLYGON_SMOOTH); gl.glBlendFunc(GL10.GL_SRC_ALPHA_SATURATE, GL10.GL_ONE); gl.glHint(GL10.GL_POLYGON_SMOOTH_HINT, GL10.GL_NICEST); // no visible diff gl.glHint(GL10.GL_PER...

RadioGroup does not appear ?

Hi all I have a linear layout with this form <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RadioGroup android:id="@+id/group" android:layout_width="wr...

Why are button sizes on Eclipse vs Device not the same.

O.k....this is weird. I had my buttons looking fine last week, now something has changed. My buttons on the eclipse emulator are much larger than on my device (Droid 2.1). I checked my skin settings, screen size permissions, density factors....what am I missing? My skin is set to WVGA854, but when the app goes to the phone the buttons...

How to get the path to the lib folder for an installed package

Shared libraries .so files are placed in lib/armeabi in an apk file. I have read after installation the libs gets extracted to /data/data/application_package/lib How can I get the exact path to this directory in my application at run time? Is this directory readable by the application? Or is only executeable access allowed? If it is re...

Android HttpClient and HTTPS

Hi all, I'm new to implementing HTTPS connections in Android. Essentially, I'm trying to connect to a server using the org.apache.http.client.HttpClient. I believe, at some point, I'll need to access the application's keystore in order to authorize my client with a private key. But, for the moment, I'm just trying to connect and see ...

ScoreNinja causes java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

I'm trying to add ScoreNinja, the global high score system, to my Android game, and it works fine when I load it on my phone, but when I release it into the wild, I got crash reports saying: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() Here is part of the call stack: android.os.H...

SOAP web client on Android

Hi I am trying to create a web service client for the android but i am stuck really bad Attached is my code and WSDL file. Please help /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.me.androidapplication1; import android.app.Activity; import android.os.Bundle; import and...

Android layout with 2 evenly spaced Buttons

I have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it. <RelativeLayout android:id="@+id/entrypopup" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px" android:visibility="gone" android:layout_below="@+id/ad" ...

Android ImageButton with a selected state?

If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but there seems to be no "highlighted" or "selected" or similar state which lets me toggle it's appearance at will. Here's my XML, it only changes...

Android/Java Beginner: Overriding ArrayAdapter's getView

Firstly I am new to android and Java so this is a beginners question. I have some code that overrides the ArrayAdapter's getView method. Here is the code public View getView(int position, View convertView, ViewGroup parent) { TextView label = (TextView)convertView; if (convertView == null) { convertView = new TextView(c...

How can I use that sliding tab widget on the Android 2.0+ lockscreen?

I'm interested in using it for one of my apps and I was wondering how I can use one of them. Are there any other similar widgets out there for 2.0+? Thanks ...

How can I connect to Android with ADB over TCP?

I am attempting to debug an application on a Motorola Droid but I am having some difficulty connecting to the device via USB. My development server is a Windows 7 64bit VM running in HyperV and so I cannot connect directly via USB in the guest or from the host. I installed a couple of different USB over TCP solutions but the connection a...

Android animation clipping when going between layouts

I have a fairly complex layout. I use a relative layout as the root and then inside of it I have a few table views and some further nesting. When I animate an imageview between these layouts my image clips. I have a background on the parent layout and the animation looks like it's going under it. I have set android:clipChildren="false" a...

Android ListView with Custom List Selector causing Flickring problem

I'm setting a selector.xml to the ListView Selector : <item android:state_focused="false" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/timeline_selected_rect"/> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@draw...