android-2.2-froyo

Android 2.2 SDK breaks compatibility with older phones

三世轮回 提交于 2019-11-28 00:26:51
问题 I have recently updated my app to a build tarket of SDK version 8 in order to include the App2SD feature for my users. However I have had reports of devices on SDK 3 (1.5) having problems starting the application, with the following stack trace: ... E/AndroidRuntime(10638): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/title_bar_shadow.9.png from drawable resource ID #0x7f020000 E/AndroidRuntime(10638): at android.content.res.Resources.loadDrawable(Resources

glGetShaderInfoLog returns empty string (android)

江枫思渺然 提交于 2019-11-28 00:23:29
问题 I am modifying the version of the android version of the 2d texture example from OpenGl ES2.0 programming guide to change the fragment shader. this is written in pure Java and doesn't use the NDK. The vanilla example works just fine on my phone, but when I change the shader code it no longer works. This is because my modified shader doesn't compile (obviously), but I can't find the cause of the problem as glGetShaderInfoLog returns an empty string. I've done a search on this issue, and

Multiple alignment in TextView?

左心房为你撑大大i 提交于 2019-11-27 20:08:46
I have a TextView like below. I used this code to set gray color for a part of the text. // Prepare result text. final String resultText = text + "\n\n" + dictionaryName; final SpannableString styledResultText = new SpannableString(resultText); styledResultText.setSpan(new ForegroundColorSpan(Color.GRAY), text.length() + 2, text.length() + 2 + dictionaryName.length(), 0); resultTextView.setText(styledResultText); Now I want to set align for it. How to do? Android doesn't have any span class for alignment. I can't find out anything like "AlignmentSpan". AFAIK this is not possible. I would

Drawable vs. Bitmap [duplicate]

こ雲淡風輕ζ 提交于 2019-11-27 19:53:20
This question already has an answer here: What is the difference between Bitmap and Drawable in Android? 4 answers I am writing a real-time game for Android, and after looking at some code from the samples provided in the SDK, I am confused as to when I should use Bitmap or Drawable for my sprites in my game. What's the difference? Which one is better (faster) for sprites and which one is better for a static background? To get an idea which is better you may want to watch this video: http://www.youtube.com/watch?v=U4Bk5rmIpic What is interesting is that he wasn't a java programmer to start

Android 2.2 SDK - setParameters failed for Camera API on Nexus One

六眼飞鱼酱① 提交于 2019-11-27 19:04:13
问题 I am using a slightly modified version of the Camera API Demo and it works in the emulator. I am using a reflect class I found in one of the mailing groups, but I still get this error when testing on my Nexus One (Android 2.2.1): 12-29 13:22:04.027: ERROR/QualcommCameraHardware(2145): Invalid preview size requested: 320x402 12-29 13:22:04.037: DEBUG/AndroidRuntime(16514): Shutting down VM 12-29 13:22:04.037: WARN/dalvikvm(16514): threadid=1: thread exiting with uncaught exception (group

Programmatically starting the 'Add Account' activity in Android 2.2

烈酒焚心 提交于 2019-11-27 18:00:49
问题 I've been experimenting with the Android SDK over the past few days, in readiness to write an App for the store, however I've run across a bit of a problem. The App I'll be writing requires that the user has a Google account associated with the phone. Retrieving and making use of the Auth token etc was not a problem, however I would like to be able to show the activity that a user would normal reach by going through the menus Settings->Accounts->Add Account. Now through experimentation I've

Android ArrayAdapter.Add method not working

南笙酒味 提交于 2019-11-27 13:45:24
问题 The ArrayAdapter.add() method is not working for me. I am using Eclipse Helios 3.6 with ADT Plugin, Target Source is a Froyo 2.2 emulator and 2.2 HTC Evo 4g. Here is my java class import android.app.Activity; import android.os.Bundle; import android.widget.ArrayAdapter; public class Main extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String[] entries = {"List Item A", "List Item B"};

Start / stop built-in Wi-Fi / USB tethering from code?

随声附和 提交于 2019-11-27 13:32:45
问题 How can I start or stop the built-in tethering in Android 2.2 from my application? 回答1: There is a non-public Tethering API in the ConnectivityManager . As shown above you can use reflection to access it. I tried this on a number of Android 2.2 phones, and it works on all of them (my HTC turns on tethering but does NOT show this in the status bar..., so check from the other end). Below is some rough code which emits debugging stuff and turns on tethering on usb0. ConnectivityManager cman =

Android SDK tools revision 12 has problem with Proguard => error conversion to Dalvik format failed with error 1 [duplicate]

為{幸葍}努か 提交于 2019-11-27 13:19:25
This question already has an answer here: Android: Getting Error: Conversion to Dalvik format failed 11 answers I have just updated to Android SDK tools revision 12, immediately my application can't be exported with previous Proguard setting. I received the "Conversion to Dalvik format failed with error 1", the only library I use is "jcifs". I have tried cleaning and rebuilding, create a new project, and reassembling and I believe I have done almost anything I can read in the Internet. Is this a new bug from this new SDK? I suggest don't update for the time being if your project use Proguard.

Reading RFID with Android phones

对着背影说爱祢 提交于 2019-11-27 09:21:51
问题 I did enough research on reading RFID tags using Android phones(smart phones). My understanding of this is that for NFC-enabled smart phones (Nexus S) it is possible to read RFID tags, but there are restrictions. For non-NFC-enabled Androids we need a RFID reader to which we can communicate from Android using Bluetooth. My question is: What are the SDK which we use for reading RFID tag from Android Phone(NFC enabled)? If I have to read using Non NFC enabled phone, is there any standard reader