android-2.2-froyo

Passing ArrayList<String> between tabs

丶灬走出姿态 提交于 2019-11-30 19:12:35
问题 I'm not very clear about the Intent object and how to use it to pass data between Activities. In my application I have several tabs between which I want to pass ArrayList. Here is a sample code I plan to use, but I'm missing the part where the main activity catches the Intent and passes it to the new activity on start : 1. myTabs.java ==> This is where I think I need to add some code to pass the data between TabOne and TabTwo. For now it is just using the sample code of the TabActivity sample

Problem with Video recording after auto focus in Android

喜你入骨 提交于 2019-11-30 18:33:49
问题 Im trying to build an app which tries to auto focus the camera before starting the video recording. Directly using MediaRecorder does not auto focus the camera. For that i am Using Camera and using the callback I can autofocus it. But providing this instance to the MediaRecorder gives me a lot of issues. Following is the code im using for recording public boolean startRecording() { try { mCamera.unlock(); mediaRecorder = new MediaRecorder(); mediaRecorder.setCamera(mCamera); mediaRecorder

Device Check (Samsung vs Others)

荒凉一梦 提交于 2019-11-30 17:24:29
I am working on an application, where there is some code implementation difference for samsung and htc, kindly have a look at my SO question Sending SMS to multiple recepients (Samsung vs HTC) How can I put a check for if the device is samsung or others(htc) MAC String manufacturer = android.os.Build.MANUFACTURER; example: Sony Ericsson samsung HTC Try this code. String strManufacturer = android.os.Build.MANUFACTURER; It will return name of Manufacturer. Ex Htc String str = android.os.Build.MODEL; It will returns name of device. Ex Htc Explorer , HTC Smith Look at this link for further info.

Alternative to setAlpha in api level 8

大兔子大兔子 提交于 2019-11-30 14:38:46
问题 I am working on an app, which can run on Froyo as well as JellyBean . I have a class that extends PageTransformer as below: import android.support.v4.view.ViewPager.PageTransformer; import android.view.View; public class ZoomOutPageTransformer implements PageTransformer { private static float MIN_SCALE = 0.85f; private static float MIN_ALPHA = 0.5f; public void transformPage(View view, float position) { int pageWidth = view.getWidth(); int pageHeight = view.getHeight(); if (position < -1) {

Tips to shift from App Inventor to Eclipse

淺唱寂寞╮ 提交于 2019-11-30 14:08:49
问题 I am very good with AppInventor to build Android apps. I have good knowledge of C++ and little knowledge of Java and GUI building in Java. Suggest me how should I shift from App Inventor to Eclipse to build Android apps? Which path should I follow? Is building in Eclipse similar to building in AppInventor like defining different components and then handling their events? Or is it much more than that? Please guide me. 回答1: There is also the AppInventor to Java Bridge project at java

Get index of selected tab in tabHost

不问归期 提交于 2019-11-30 14:01:27
问题 I'm trying to store the index of the currently selected tab in onSaveInstanceState so I can restore it. However the getCurrentTab apparantely gives me back the String I used in the etTabHost().newTabSpec, which I find a bit weird since the documentation says it returns an int and setCurrentTab also taking an int. Does anyone know how I can get the index of my currently selected tab so I can restore it? 回答1: you are on the right way, use setOnTabChangedListener to get your selected tab. public

Alternative to setAlpha in api level 8

a 夏天 提交于 2019-11-30 11:11:56
I am working on an app, which can run on Froyo as well as JellyBean . I have a class that extends PageTransformer as below: import android.support.v4.view.ViewPager.PageTransformer; import android.view.View; public class ZoomOutPageTransformer implements PageTransformer { private static float MIN_SCALE = 0.85f; private static float MIN_ALPHA = 0.5f; public void transformPage(View view, float position) { int pageWidth = view.getWidth(); int pageHeight = view.getHeight(); if (position < -1) { view.setAlpha(0); } else if (position <= 1) { float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs

Cannot get list of public rooms from xmpp Server on Android?

若如初见. 提交于 2019-11-30 10:28:57
Hello Everyone i am new to android and i am currently stuck on this. I have to return list of public rooms created on xmpp server. The problem i am having is that the code below works fine for java but there is a null pointer exception in case of android. Any help regarding this would be appreciated. I am using an openfire server and testing it on local machine so that is the reason why i am using ip Address instead of domain name. I am using smack library for JAVA and Asmack Library for android String server_name = "192.168.3.113"; ConnectionConfiguration config = new ConnectionConfiguration(

Tips to shift from App Inventor to Eclipse

人盡茶涼 提交于 2019-11-30 09:39:49
I am very good with AppInventor to build Android apps. I have good knowledge of C++ and little knowledge of Java and GUI building in Java. Suggest me how should I shift from App Inventor to Eclipse to build Android apps? Which path should I follow? Is building in Eclipse similar to building in AppInventor like defining different components and then handling their events? Or is it much more than that? Please guide me. There is also the AppInventor to Java Bridge project at java.appinventor.org , details see below About: The AppInventor to Java Bridge project is an addition to AppInventor that

Android 2.2 and “Bad address family” on Socket Connect

左心房为你撑大大i 提交于 2019-11-30 09:20:49
I have a fairly simple game that works perfectly on every version now up through 2.1, but with the new 2.2 (Froyo) release I am unable to create a socket. I am using the mina package for nio, and get this exception: W/System.err( 263): java.net.SocketException: Bad address family W/System.err( 263): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method) W/System.err( 263): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115) W/System.err( 263): at org.apache.harmony.nio.internal.SocketChannelImpl.connect