[android-beginners] Re: Adding Undo feature in FingerPaint app bundled with APIdemos.
@Romain: thanks for your reply...I'd *like* to believe that you wrote FingerPaint and would help me here :) Most of the applications in the Android Market(PicSay et al.) that provide a similar feature(drawing strokes on canvas) provide Undo functionality. I was trying to imitate the same in the original FingerPaint app. My approach to implementing this feature,as already mentioned in the earlier post, would be to: 1. memorize all the paths, 2. reset the canvas and 3. redraw all the paths again expect the last one. I was wondering if there was any alternative to this? Is there any class in the framework that can help me here? Please help. Thanks again! On Oct 7, 9:34 pm, Romain Guy romain...@google.com wrote: save() and restore() are just used to save the state of the Canvas (translate, scale, etc.) It won't help you for what you want. On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta samuh.va...@gmail.com wrote: I am playing with the FingerPaint application that comes bundled with the API demos package. I was wondering if I could add an Undo feature to it, which would allow the user to remove/undo his latest stroke drawing from the canvas. I am not sure of how to achieve this though. I was looking at the android.graphics.Canvas class and therein I found a few methods that caught my interest. canvas.restore() and canvas.save(). But I couldn't get them to work per my requirement. One of the approach could be memorizing all the Path(representing strokes drawn) and then resetting the canvas and reapinting all the stroked one by one except the latest. I somehow dont like this approach. How do I undo my drawings on canvas? Please help. Thanks. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: read phone's number?
Maybe the following could be of some help: http://www.androidsnippets.org/snippets/108/ On Oct 8, 5:04 am, Jeffrey Blattman jeffrey.blatt...@gmail.com wrote: is there a way to read the phone's (current) phone number? i realize this would require a permission grant at least. thanks. -- -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to extract ICON from an APK file?
Hi, I found the path is stored in resources.arsc, but where to indicates the index? BR, KK On Oct 7, 11:48 am, KK guo.jing...@gmail.com wrote: Sorry, I'm NOT using android API On Oct 7, 11:40 am, KK guo.jing...@gmail.com wrote: Actually I'm doing a shell extension for windows, showing the icon of apk files in windows, isn't it a good idea? :D so I want to know where the icon located in apk file, and I'm using android API... Thanks for your tip, at least I can go and see the source code of packagemanager.. BR, KK On Oct 7, 2:58 am, Justin Anderson janderson@gmail.com wrote: What exactly are you trying to do with this icon? You can get the icon of an installed application on your phone via PackageManager.getActivityIcon() or PackageManager.getApplicationIcon(). http://developer.android.com/reference/android/content/pm/PackageMana... Thanks, Justin -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Tue, Oct 6, 2009 at 12:50 AM, KK guo.jing...@gmail.com wrote: Hi, I'm trying to get the icon from an apk file, but I found not every app use the the icon.png under res/, and androidmanifest.xml is compiled inside apk, where I can get the position information? Thx BR, KK- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to get resource path?
Hi, I have included three MP3 file in the R.raw folder. Now I am able to get the file name of the MP3 file, but I need to find out the complete path of the file in order to play the file using MediaPlayer. I am using MediaPlayer.setDataSource(String path) to set the path to the file. When I set the path as just the file name, the MediaPlayer does not play it. Is there any way to get the full path of the MP3 file in resources? Or else, can I use some other implementation of MediaPlayer.setDataSource ()? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Eclair code Surface Flinger Implementation
Hi, Anybody Know whether in *Eclair code* Base Surface Flinger is Using CopyBit functionality through HAL or the Compostion Happens using EGL Implementation for Merging the Surface. Thanks in Advance subbu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to find permissions required
I am trying to see if some of the classes I am using require any permissions to be set on the manifest. How can I tell if a given Class requires a permission. Example I know PowerManager.WakeLock needs the WAKE_LOCK permission but the documentation on PowerManager.WakeLock makes no reference to any permissions required. How would I have found this with out the example code I found telling me? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to find permissions required
I've found that there is an error reported in the logcat which is quite clear about a missing permission. Just keep going and look at the logcat output. John On Oct 8, 5:13 am, Chris themaninthesuitc...@googlemail.com wrote: I am trying to see if some of the classes I am using require any permissions to be set on the manifest. How can I tell if a given Class requires a permission. Example I know PowerManager.WakeLock needs the WAKE_LOCK permission but the documentation on PowerManager.WakeLock makes no reference to any permissions required. How would I have found this with out the example code I found telling me? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to find permissions required
I take it this would need to be done on a real device not the emulator? On Oct 8, 10:38 am, jbrohan jbro...@gmail.com wrote: I've found that there is an error reported in the logcat which is quite clear about a missing permission. Just keep going and look at the logcat output. John On Oct 8, 5:13 am, Chris themaninthesuitc...@googlemail.com wrote: I am trying to see if some of the classes I am using require any permissions to be set on the manifest. How can I tell if a given Class requires a permission. Example I know PowerManager.WakeLock needs the WAKE_LOCK permission but the documentation on PowerManager.WakeLock makes no reference to any permissions required. How would I have found this with out the example code I found telling me? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Application in full screen mode ...
hello all i want my application to run in full screen mode ... so i have written following code in my main activity SplashScreenActivity ... public static void setWindowsProperties(Activity activity) { // set the window properties activity.getWindow().requestFeature(Window.FEATURE_NO_TITLE); activity.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); activity .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); activity.setContentView(R.layout.splashscreen); // print some info Log.d(TAG, width -- + activity.getWindowManager().getDefaultDisplay().getWidth()); Log.d(TAG, height -- + activity.getWindowManager().getDefaultDisplay().getHeight()); Log.d(TAG, orientation -- + activity.getRequestedOrientation()); } Now my question is ... in each activity of my application do i need to call above util method? is there any way in which i just set the properties once and all the activities getting called afterwords would have full screen enabled ? thanks best regards, ~pp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Application in full screen mode ...
please ignore line activity.setContentView(R.layout.splashscreen); from above code ... :) On Oct 8, 5:18 pm, preetam_pict preetam.pa...@gmail.com wrote: hello all i want my application to run in full screen mode ... so i have written following code in my main activity SplashScreenActivity ... public static void setWindowsProperties(Activity activity) { // set the window properties activity.getWindow().requestFeature(Window.FEATURE_NO_TITLE); activity.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); activity .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); activity.setContentView(R.layout.splashscreen); // print some info Log.d(TAG, width -- + activity.getWindowManager().getDefaultDisplay().getWidth()); Log.d(TAG, height -- + activity.getWindowManager().getDefaultDisplay().getHeight()); Log.d(TAG, orientation -- + activity.getRequestedOrientation()); } Now my question is ... in each activity of my application do i need to call above util method? is there any way in which i just set the properties once and all the activities getting called afterwords would have full screen enabled ? thanks best regards, ~pp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Application in full screen mode ...
I use theme to get full view - android:theme=@android:style/ Theme.NoTitleBar.Fullscreen. On Oct 8, 7:23 am, preetam_pict preetam.pa...@gmail.com wrote: please ignore line activity.setContentView(R.layout.splashscreen); from above code ... :) On Oct 8, 5:18 pm, preetam_pict preetam.pa...@gmail.com wrote: hello all i want my application to run in full screen mode ... so i have written following code in my main activity SplashScreenActivity ... public static void setWindowsProperties(Activity activity) { // set the window properties activity.getWindow().requestFeature(Window.FEATURE_NO_TITLE); activity.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); activity .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); activity.setContentView(R.layout.splashscreen); // print some info Log.d(TAG, width -- + activity.getWindowManager().getDefaultDisplay().getWidth()); Log.d(TAG, height -- + activity.getWindowManager().getDefaultDisplay().getHeight()); Log.d(TAG, orientation -- + activity.getRequestedOrientation()); } Now my question is ... in each activity of my application do i need to call above util method? is there any way in which i just set the properties once and all the activities getting called afterwords would have full screen enabled ? thanks best regards, ~pp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: File length is 0, which is not true... ?
Could be that the value of file.length is cached, and the file didn't exist when you started. What happens if you do: new File (test.tmp).length() On 8 Okt, 14:26, joare...@googlemail.com joare...@googlemail.com wrote: Hello, I really dont know why file.lengt returns 0 all the time, can u help me ? public void getFileFromInternet(String tempUrl) { HttpClient httpClient = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(tempUrl); try { HttpResponse response = httpClient.execute(httpGet); response = httpClient.execute(httpGet); HttpEntity entity = response.getEntity(); InputStream inputStream = entity.getContent(); File myNewFile = new File(test.tmp); FileOutputStream out = context.openFileOutput(myNewFile.getName(), Context.MODE_WORLD_WRITEABLE); byte buf[] = new byte[1024]; int len; while ((len = inputStream.read(buf)) 0) out.write(buf, 0, len); out.close(); inputStream.close(); Log.d(TEST, Long.toString(myNewFile.length())); // myNewFile.length() is always 0 although the file is stored in the DDMS and is bigger than 0 } catch (Exception e) { e.printStackTrace(); } httpClient.getConnectionManager().shutdown(); } Can anyone tell me what I did wrong ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: File length is 0, which is not true... ?
Does not work either: public void getFileFromInternet(String tempUrl) { HttpClient httpClient = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(tempUrl); try { HttpResponse response = httpClient.execute(httpGet); response = httpClient.execute(httpGet); HttpEntity entity = response.getEntity(); Long lastacc = System.currentTimeMillis(); String fileName = cashed_ + Long.toString(lastacc) + .tmp; File myNewFile = new File(fileName); InputStream inputStream = entity.getContent(); FileOutputStream out = context.openFileOutput(myNewFile.getName(), Context.MODE_WORLD_WRITEABLE); byte buf[] = new byte[1024]; int len; while ((len = inputStream.read(buf)) 0) out.write(buf, 0, len); out.close(); inputStream.close(); Log.d(TSSTT, Long.toString(new File(fileName).length())); // also 0 } catch (Exception e) { e.printStackTrace(); } httpClient.getConnectionManager().shutdown(); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Application in full screen mode ...
thanks sDroid ! I tried following code ... @Override public void onCreate(Bundle savedInstanceState) { // this should be before calling super.onCreate()! setTheme(android.R.style.Theme_NoTitleBar_Fullscreen); super.onCreate(savedInstanceState); setContentView(R.layout.splashscreen); } But i have to do this in every activity right ? Thanks ~pp On Oct 8, 6:24 pm, sDroid hvn4...@gmail.com wrote: I use theme to get full view - android:theme=@android:style/ Theme.NoTitleBar.Fullscreen. On Oct 8, 7:23 am, preetam_pict preetam.pa...@gmail.com wrote: please ignore line activity.setContentView(R.layout.splashscreen); from above code ... :) On Oct 8, 5:18 pm, preetam_pict preetam.pa...@gmail.com wrote: hello all i want my application to run in full screen mode ... so i have written following code in my main activity SplashScreenActivity ... public static void setWindowsProperties(Activity activity) { // set the window properties activity.getWindow().requestFeature(Window.FEATURE_NO_TITLE); activity.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); activity .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); activity.setContentView(R.layout.splashscreen); // print some info Log.d(TAG, width -- + activity.getWindowManager().getDefaultDisplay().getWidth()); Log.d(TAG, height -- + activity.getWindowManager().getDefaultDisplay().getHeight()); Log.d(TAG, orientation -- + activity.getRequestedOrientation()); } Now my question is ... in each activity of my application do i need to call above util method? is there any way in which i just set the properties once and all the activities getting called afterwords would have full screen enabled ? thanks best regards, ~pp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Application in full screen mode ...
preetam_pict wrote: thanks sDroid ! I tried following code ... @Override public void onCreate(Bundle savedInstanceState) { // this should be before calling super.onCreate()! setTheme(android.R.style.Theme_NoTitleBar_Fullscreen); super.onCreate(savedInstanceState); setContentView(R.layout.splashscreen); } But i have to do this in every activity right ? 1. You are better served doing this in the manifest via the android:theme attribute. That way, the title and status bars will be gone immediately, rather than after onCreate() returns. 2. Yes, you have to do this on every activity for which you want the full screen. Bear in mind that what you want should be secondary to what the user wants, and users tend to want to see their battery level, signal strength, and such. Hence, please be judicious about your use of full-screen themes. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: someone plz help me .. how to call built in camera app from my custom app ??
Do some debugging work... The PackageManager can give you a list of all applications on your phone. Step through them and find the Camera application and note the package name of the camera application. Assuming you have done that, you can do something similar to the following (obviously putting in checks for the case the application doesn't exist, etc...): String packageName = package name found in above steps; PackageManager mgr = getPackageManager(); Intent intent = mgr.getLaunchIntentForPackage(packageName); startActivity(intent); If the getLaunchIntentForPackage method returns null, as it sometimes does, then you will have to create a new intent instead with something similar to this: Intent intent = new Intent(); intent.setClassName(packageName, className); I have not looked into how to find the className of an arbitrary application but I'm sure with a little work you can figure it out. I have already explained to you how to do this, both in these forums and when you emailed me directly. Rather than continually posting the same question over and over and waiting for someone to do your coding for you and give you complete functional code, I would suggest looking through the developer guide and the SDK reference docs and trying to figure it out for yourself. http://developer.android.com/reference/packages.html http://developer.android.com/guide/index.html Thanks, Justin -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Thu, Oct 8, 2009 at 3:43 AM, wahib wahib.t...@gmail.com wrote: Hi !! I have a straightforward question. I just want to call and execute the built-in camera app i click button in my application. Being a newbie i have no idea how to code for it. plz share source code if anyone has done it. Regards, wahib --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Application in full screen mode ...
Thank you sir ! I added following in the manifest.xml application android:icon=@drawable/icon android:label=@string/ app_name android:theme=@android:style/Theme.NoTitleBar.Fullscreen android:screenOrientation=landscape and the application is full screen enabled ! as you correctly said ... by this mechanism i am able to see the full screen effect immediately ... whereas previously i used to see the titlebar for fraction of second! well ... i am developing an application which would run on an android device (and not the android phone!) ... so i want the application to start immediately after the device is powered on (and booted successfully) i am planning to show the battery strength , n/w strength etc on the home screen of my application ... lets see ... thanks a lot for the help ! ~pp On Oct 8, 7:52 pm, Mark Murphy mmur...@commonsware.com wrote: preetam_pict wrote: thanks sDroid ! I tried following code ... @Override public void onCreate(Bundle savedInstanceState) { // this should be before calling super.onCreate()! setTheme(android.R.style.Theme_NoTitleBar_Fullscreen); super.onCreate(savedInstanceState); setContentView(R.layout.splashscreen); } But i have to do this in every activity right ? 1. You are better served doing this in the manifest via the android:theme attribute. That way, the title and status bars will be gone immediately, rather than after onCreate() returns. 2. Yes, you have to do this on every activity for which you want the full screen. Bear in mind that what you want should be secondary to what the user wants, and users tend to want to see their battery level, signal strength, and such. Hence, please be judicious about your use of full-screen themes. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to get resource path?
getResources().openRawResourceFd(int id) Get the FileDescriptor for the file and use MediaPlayer.setDataSource (FileDescriptor fd) method. Balwinder Kaur Mobile.Software.Development ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Oct 8, 12:55 am, abhi rkabhi1...@gmail.com wrote: Hi, I have included three MP3 file in the R.raw folder. Now I am able to get the file name of the MP3 file, but I need to find out the complete path of the file in order to play the file using MediaPlayer. I am using MediaPlayer.setDataSource(String path) to set the path to the file. When I set the path as just the file name, the MediaPlayer does not play it. Is there any way to get the full path of the MP3 file in resources? Or else, can I use some other implementation of MediaPlayer.setDataSource ()? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: What API should I use ? Local Service Binding ? Remote Service Binding ? Handler ?)
hi, I tried the same program wht u mentioned, for me it is working fine. u chk in logcat file for confirmation whether the service is stopped or not giving some log statements in ur code On Oct 5, 11:01 am, Tim vkan...@gmail.com wrote: Hello, I am very new beginner, and I am designing a smallapplicationas below. - After a userstartstheapplication, he/she can click the start button to start a background task. (e.g. retrieving the news headlines periodically, then do something...) - Even after the user quits theapplication, the background task still running. - To stop the background task, the user needs to run theapplication again, and clicks the stop button to stop the background task. In the above scenario, what API should I use ? (LocalService Binding ? RemoteServiceBinding ? Handler ?) Please help me. Thank you very much. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] emulator stopped during orientation converting
Hello all! I implemented image and text using RelativeLayout. Here is xml code. ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/background android:layout_gravity=center ImageView android:id=@+id/image android:layout_width=wrap_content android:layout_height=wrap_content android:layout_centerVertical=true android:layout_centerHorizontal=true android:src=@drawable/photo_3 android:scaleType=fitCenter / TextView android:id=@+id/text android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/main_title android:layout_alignParentTop=true android:layout_marginTop=10dip android:layout_centerHorizontal=true android:textSize=24.5sp / /RelativeLayout When I use portrait picture emulator stops after I convert the orientation of emulator. And then I start again that application with converted state of orientaion, it works. It is so weird. : There is no problem if I use landscape picture. Here is the message of LogCat. ERROR/dalvikvm-heap(785): 9830400-byte external allocation too large for this process ERROR/(785): VM won't let us allocate 9830400 bytes ERROR/AndroidRuntime(785): Uncaught handler: thread main exiting due to uncaught exception ERROR/AndroidRuntime(785): java.lang.RuntimeException: Unable to start activity ComponentInfo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Development Phone
I can't seem to find the answer to this anywhere, so if someone could take a crack at it or point me in the right direction, I would appreciate it. I have the Google Ion (the phone handed out at the Google IO Developer's Conference), but I have no idea how to upgrade the OS to 1.6. The HTC support website has some information on how to do it and the necessary files, but the instructions are way above my head (I don't know where to input a command line, how to bootload, or anything). I got this as a gift and really want to upgrade it to 1.6 so any help would be appreciated. Anybody have time this weekend to provide an Android for Dummies type of explanation? Thanks! ~Gene On Sep 17, 6:02 pm, brucko geoff.bruck...@gmail.com wrote: I'll be the first to admit that I am a bit of a novice in the android arena. What I would like to bring to your attention is that there may well be very good reasons as to why some pre-installed apps can be hard to change. I'm trying to import some devices into Australia, many of our regulations are based on the US and Europe. If you change some of the key software on a phone you may very well make it illegal to use that phone. One key example would be the requirement we have to be able to dial emergency numbers even when the screen is locked. Someones life may depend on this functionality being intact. I have no idea what the legal ramifications would be of making software available that did not maintain this ability. However selling, giving or even loaning phones with emergency dialing no longer enabled would certainly be an offense. ( Not saying you shouldn't replace these apps - just be careful) ...brucko On Aug 29, 3:53 am, Chris Stratton cs07...@gmail.com wrote: On Aug 24, 9:09 am, Ran dahan...@gmail.com wrote: What is the benefit of working with ADP1 over the other Android phones ? Just to expand on what others have said: Cost seems comparable betwen a dev phone and a retail phone at full retail or plan price + termination fee, so it's really more a of a technical question. Reasons for a dev phone -sim unlocked (some such as tmobile may? do that if you pay full retail or eventually on a plan) -can change linux and system libraries -can change pre-installed applications -tmobile myfaves application sends periodic sms which costs money on any other network Reasons for _not_ getting a dev phone -only one older dev phone model generally available at present -dev phones can't buy paid applications from the market (including your own) -if you sell apps, you need to restrict yourself to the capabilities of your users phones (and test on such adevice!) -various preinstalled proprietary applications missing (+/- depending on your interest) The not being able to change preinstalled applications is in my mind the least anticipated, and most annoying, problem. There are many areas where very small decisions of questionable wisdom in default applications really hamper the user experience (even in the using it just to make calls sense), but these can't be very readily changed on a retail phone, particularly the parts most closely involved in the telephone functionality. As of this moment, I believe most of the retail phones are probably still shipping with an easily rooted linux kernel, but that probably will get closed up (already fixed in google's tree) and they will be limited until another hole is found. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Updating Google Ion from 1.5 to 1.6
I have a Google Ion (the version of the HTC Magic that was handed out at the Google IO Developers Conference) that was given to me as a gift. Unfortunately, I have no idea how to update the OS on the phone to 1.6. I looked up the HTC support website and I have all the necessary files, but I have no idea how to execute any of the instructions. HTC tech support directed me to this community. Just to highlight my level of ignorance: I don't know how to use a command line, I have no idea what a bootloader is, I don't know how to use the SDK (although I have it on my computer and I installed Eclipse as well), etc. If anybody has time to run through a true Android for Dummies guide to upgrade my phone to 1.6, I would be forever grateful. Thanks! Gene --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: read phone's number?
Hi, Code snippets to get phone details and permission required to set code snippets Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null); startManagingCursor(c); String[] phonenames = new String[]{People.NAME}; String[] phonenumbers=new String[]{People.NUMBER}; mAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c, phonenumbers, new int[] {android.R.id.text1} ); acAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c, phonenames, new int[] {android.R.id.text1} ); / Permissions Required:-- uses-permission android:name=android.permission.READ_CONTACTS / // On Wed, Oct 7, 2009 at 11:44 PM, Samuh Varta samuh.va...@gmail.com wrote: Maybe the following could be of some help: http://www.androidsnippets.org/snippets/108/ On Oct 8, 5:04 am, Jeffrey Blattman jeffrey.blatt...@gmail.com wrote: is there a way to read the phone's (current) phone number? i realize this would require a permission grant at least. thanks. -- -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: problem creating new android project
Do you have the Android ADK installed. If you do, you ought to be able to select it in the build target box which will make the error that is appearing at the top about specifying the SDK. Try following the install directions here: http://developer.android.com/sdk/1.6_r1/installing.html and see if that fixes it -BrannDon On Oct 3, 3:02 pm, mugdha lakhani muggi...@gmail.com wrote: Hi, I have just installed android ADT in eclipse. And when I try to create a new android project, I cannot specify the SDK target due to some weird GUI problem, there are no checkboxes to click on! I am enclosing a screenshot so that you can understand what I am talking about. I have to set this up fast...is there any other way to specify the SDK target and make it work? I cannot create a project before specifying this. I have my android SDK's path included in preference-android, and the android tools directory included in the system PATH variables. I tried creating a simple java project and converting it to android project without much success. Thanks Mugdha screenshot.bmp 1229KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to access the files on SD card through emulator?
Hi, I need to search for certain type of files (like .mp3) and populate the list of files present in that particular category from the SD card. Can anyone help me with this? -Regards Abhi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to use the Network Manager?
I need to connect my device to the network. I have a preference order of Wifi/GPRS/dial-up modem in sequence. How do I go about it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: someone plz help me .. how to call built in camera app from my custom app ??
In the SDK samples have a look at android-sdk-windows-1.6_r1\platforms\android-1.5\samples\ApiDemos\src \com\example\android\apis\graphics\CameraPreview.java On Oct 8, 10:43 am, wahib wahib.t...@gmail.com wrote: Hi !! I have a straightforward question. I just want to call and execute the built-in camera app i click button in my application. Being a newbie i have no idea how to code for it. plz share source code if anyone has done it. Regards, wahib --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How will users upgrade their firmware?
I was going through the flashing procedure for the ADP1 and this is what I get from there: If you are using the fastboot method for upgrading the firmware, there is are specific commands to erase userdata and cache : $ fastboot erase userdata $ fastboot erase cache or $ fastboot update imagepackage.zip [-w] The optional -w will do both erase userdata and cache. This group is specifically for Android updates: http://groups.google.com/group/Android-DevPhone-Updating where you might find better answers, On Oct 6, 11:12 pm, Mr. INTJ mr.i...@gmail.com wrote: I'm trying to understand how users will upgrade their firmware without losing their application data. I'm assuming that system.img and userdata.img will be replaced during a firmware upgrade (both files are generated when building the Android source code--among others). My understanding is that system.img is r/ o, so no user data would be lost, however userdata.img is r/w, and contains any application data the user may have saved. Simply overwriting this file with a newer release would destroy all the user's application data (right?) I've RTFM and STFW for details on how this is supposed to work. I'm only finding adb commands and other hacker-level instructions. Thanks in advance. -Mr. INTJ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to program a key press on a service
I have to make a background program that read an input from a joystick and associate the data to a key, for example the UP key or TAB key etc., so to interact with the system and use it, always for example, to control the choice of incoming calls. I mean, I receive an incoming call, I use the joystick, pushing the stick left or right, to focus the answer to the call button or the hang up button and then click the fire, or push up or whatever other thing to select the selection I made. Can someone tell me where to look for find some instructions for associate the key? Thank you all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to access the files on SD card through emulator?
Instructions here: http://developer.android.com/guide/developing/tools/emulator.html#diskimages j On Thu, Oct 8, 2009 at 8:46 AM, Abhi hk.abhij...@gmail.com wrote: Hi, I need to search for certain type of files (like .mp3) and populate the list of files present in that particular category from the SD card. Can anyone help me with this? -Regards Abhi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: someone plz help me .. how to call built in camera app from my custom app ??
Dear Justin !! Thanks again as always. I understand your point. I'll try my best to work it out myself in future. I hope this time it works out. On 10/8/09, RichardC richard.crit...@googlemail.com wrote: In the SDK samples have a look at android-sdk-windows-1.6_r1\platforms\android-1.5\samples\ApiDemos\src \com\example\android\apis\graphics\CameraPreview.java On Oct 8, 10:43 am, wahib wahib.t...@gmail.com wrote: Hi !! I have a straightforward question. I just want to call and execute the built-in camera app i click button in my application. Being a newbie i have no idea how to code for it. plz share source code if anyone has done it. Regards, wahib -- Wahib-ul-haq Communications Engineering Student, NUST, Pakistan. www.sizzlotech.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Adding Undo feature in FingerPaint app bundled with APIdemos.
Hi Samuh, I think you're on the right path. Cheers, James On Wed, Oct 7, 2009 at 11:42 PM, Samuh Varta samuh.va...@gmail.com wrote: @Romain: thanks for your reply...I'd *like* to believe that you wrote FingerPaint and would help me here :) Most of the applications in the Android Market(PicSay et al.) that provide a similar feature(drawing strokes on canvas) provide Undo functionality. I was trying to imitate the same in the original FingerPaint app. My approach to implementing this feature,as already mentioned in the earlier post, would be to: 1. memorize all the paths, 2. reset the canvas and 3. redraw all the paths again expect the last one. I was wondering if there was any alternative to this? Is there any class in the framework that can help me here? Please help. Thanks again! On Oct 7, 9:34 pm, Romain Guy romain...@google.com wrote: save() and restore() are just used to save the state of the Canvas (translate, scale, etc.) It won't help you for what you want. On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta samuh.va...@gmail.com wrote: I am playing with the FingerPaint application that comes bundled with the API demos package. I was wondering if I could add an Undo feature to it, which would allow the user to remove/undo his latest stroke drawing from the canvas. I am not sure of how to achieve this though. I was looking at the android.graphics.Canvas class and therein I found a few methods that caught my interest. canvas.restore() and canvas.save(). But I couldn't get them to work per my requirement. One of the approach could be memorizing all the Path(representing strokes drawn) and then resetting the canvas and reapinting all the stroked one by one except the latest. I somehow dont like this approach. How do I undo my drawings on canvas? Please help. Thanks. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: What API should I use ? Local Service Binding ? Remote Service Binding ? Handler ?)
Hi Tim, There's a local service binding example in ApiDemos which I'm pretty sure does exactly that: http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceBinding.html However, I think you're better off using AlarmManager to start a service periodically. This is a common practice, and you should be able to find more information about it in this and other forums. Cheers, James On Sun, Oct 4, 2009 at 11:01 PM, Tim vkan...@gmail.com wrote: Hello, I am very new beginner, and I am designing a small application as below. - After a user starts the application, he/she can click the start button to start a background task. (e.g. retrieving the news headlines periodically, then do something...) - Even after the user quits the application, the background task still running. - To stop the background task, the user needs to run the application again, and clicks the stop button to stop the background task. In the above scenario, what API should I use ? (Local Service Binding ? Remote Service Binding ? Handler ?) Please help me. Thank you very much. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Double-Permissions when publishing to Android Market?
It's a bug :) and the permissions will be appear correctly on the phone. Cheers, James On Tue, Oct 6, 2009 at 3:48 AM, Alexander Kazanin alexander.kaza...@gmail.com wrote: Hi. Any ideas on what's happening, or if it's happened to anybody else, would be greatly appreciated:) Yes, the same thing happened to our app, all permissions doubled. However it's still runs fine, no problems were detected. I guess google is changing smth in maket's infrastructure and this is some weird bug =) ~~ Regards, Alexander Kazanin http://sites.google.com/site/piggybanksoftwarehomepage On Oct 6, 12:25 pm, callingshotgun callingshot...@gmail.com wrote: I'm running into a strange issue publishing on the Android market, and am wondering if anybody else has seen the same: Basically, whatever permissions I list in my Android Manifest file get listed twice when I upload the APK. By way of example, here's a direct copy/paste from the upload area... -- This apk requests 6 permissions that users will be warned about 'android.permission.READ_CONTACTS' 'android.permission.WRITE_CONTACTS' 'android.permission.CALL_PHONE' android.permission.READ_CONTACTS android.permission.WRITE_CONTACTS android.permission.CALL_PHONE -- And here are the three relevant lines in my android manifest file --- uses-permission android:name=android.permission.CALL_PHONE/ uses-permission android:name=android.permission.READ_CONTACTS/ uses-permission android:name=android.permission.WRITE_CONTACTS/ -- I've tried uploading in FF3.5, IE7, and IE8, and modified the permissions tags to end with a space before the trailing / and without. Every permutation of any possible quirk I try to work around, still ends up with the whole everything listed twice issue. Those three permission tags are direct children of the manifest tag. I don't actually know if this is something I should even care about, but I did notice earlier today that I couldn't search for my application (Contacts Evolved) in the market, wheras I could before my phone updated to donut... I had to un-publish and re-publish the app for it to show up again. It downloads fine now, but still gives me the feeling that something is wrong that might cause issues down the line, and I'd like to get it fixed. Any ideas on what's happening, or if it's happened to anybody else, would be greatly appreciated:) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Socket client does not work with emulator
Hi, I am trying to create a connection between a server socket program written in C and an android client socket program. Now when I write a regular java client program such as: try { Socket socket = new Socket(localhost, 5554); PrintWriter out = new PrintWriter(echoSocket.getOutputStream (), true); } catch(Exception e) { // } out.println(Hello World); This program works perfectly and my server.c file receives the message. However, when I try the same program with the Android Emulator, I get an Error:java.net.ConnectException: localhost/127.0.0.1:5554 - Connection refused I have tried different ports as well (, 3490). This works perfectly with the regular Java project, but the moment I write the same code in an Android project I get that error. I have been stuck on this all day and am really getting frustrated :( Would appreciate any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to use the Network Manager?
Based on your preferred interface list, I would first do a scan on Wifi. Look for open Wifi networks to connect without security codes. Otherwise open a dialog that the user can enter the security information for the secured network. If no Wifi network is available turn off Wifi which automatically triggers to connect to cellular data. Have a broadcast receiver implemented to check for network changes. When you receive a network change you can use the code below to find out what your actual network is. To find out about your current connection: ConnectivityManager connection = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connection.getActiveNetworkInfo(); Log.d(TAG,type:+networkInfo.getTypeName()); To connect to a wifi network you have to create a WifiConfiguration. After adding your configuration to the WifiMgr with mWifiMgr.addNetwork(wifiConfiguration); you can connect to the network with boolean successConnected = mWifiMgr.enableNetwork(inetId, true); In your broadcast receiver you should receive an intent about the network status change. -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Oct 8, 3:29 am, Gautam Tripathi guts.gau...@gmail.com wrote: I need to connect my device to the network. I have a preference order of Wifi/GPRS/dial-up modem in sequence. How do I go about it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Socket client does not work with emulator
Hi Android n00b, http://groups.google.com/group/android-developers/browse_thread/thread/acd93714ebb3b2fc/101c925eeefaed15 http://groups.google.com/group/android-developers/browse_thread/thread/acd93714ebb3b2fc/101c925eeefaed15 Cheers, James On Thu, Oct 8, 2009 at 12:57 PM, Android_n00b nikhil...@gmail.com wrote: Hi, I am trying to create a connection between a server socket program written in C and an android client socket program. Now when I write a regular java client program such as: try { Socket socket = new Socket(localhost, 5554); PrintWriter out = new PrintWriter(echoSocket.getOutputStream (), true); } catch(Exception e) { // } out.println(Hello World); This program works perfectly and my server.c file receives the message. However, when I try the same program with the Android Emulator, I get an Error:java.net.ConnectException: localhost/127.0.0.1:5554 - Connection refused I have tried different ports as well (, 3490). This works perfectly with the regular Java project, but the moment I write the same code in an Android project I get that error. I have been stuck on this all day and am really getting frustrated :( Would appreciate any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Socket client does not work with emulator
Localhost (127.0.0.1) is the address of the phone or the emulator. I assume that your server program in C is on your devlopment machine. So you need to connect to your PC's IP address. You can use ADB http://developer.android.com/guide/developing/tools/adb.html to setup port forwarding from the device to your PC. -- RichardC On Oct 8, 8:57 pm, Android_n00b nikhil...@gmail.com wrote: Hi, I am trying to create a connection between a server socket program written in C and an android client socket program. Now when I write a regular java client program such as: try { Socket socket = new Socket(localhost, 5554); PrintWriter out = new PrintWriter(echoSocket.getOutputStream (), true);} catch(Exception e) { //} out.println(Hello World); This program works perfectly and my server.c file receives the message. However, when I try the same program with the Android Emulator, I get an Error:java.net.ConnectException: localhost/127.0.0.1:5554 - Connection refused I have tried different ports as well (, 3490). This works perfectly with the regular Java project, but the moment I write the same code in an Android project I get that error. I have been stuck on this all day and am really getting frustrated :( Would appreciate any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Socket client does not work with emulator
Hi James, Thanks a lot! I actually just figured it out as well and was about to post my solution here. http://developer.android.com/guide/developing/tools/emulator.html#emulatornetworking So for anyone having a similar problem, Basically 10.0.2.2 is the Android Emulator's alias to 127.0.0.1 The emulator does not understand when you specify localhost So change the line: Socket socket = new Socket(localhost, 5554); to Socket socket = new Socket(10.0.2.2, 5554); Cheers! On Oct 8, 4:26 pm, James Yum j...@google.com wrote: Hi Android n00b, http://groups.google.com/group/android-developers/browse_thread/threa... http://groups.google.com/group/android-developers/browse_thread/threa... Cheers, James On Thu, Oct 8, 2009 at 12:57 PM, Android_n00b nikhil...@gmail.com wrote: Hi, I am trying to create a connection between a server socket program written in C and an android client socket program. Now when I write a regular java client program such as: try { Socket socket = new Socket(localhost, 5554); PrintWriter out = new PrintWriter(echoSocket.getOutputStream (), true); } catch(Exception e) { // } out.println(Hello World); This program works perfectly and my server.c file receives the message. However, when I try the same program with the Android Emulator, I get an Error:java.net.ConnectException: localhost/127.0.0.1:5554 - Connection refused I have tried different ports as well (, 3490). This works perfectly with the regular Java project, but the moment I write the same code in an Android project I get that error. I have been stuck on this all day and am really getting frustrated :( Would appreciate any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: 1.6: Quick search box to pass parameters to an application
Nevermind, found the SearchableDictionary example in the SDK which gave me enough. On Oct 8, 9:24 am, Danny Brain tehdan...@gmail.com wrote: Hey, I was wondering if it were possible to use the quick search box to pass parameters to an application? E.g. If I had a timesheet application called HagridIsHugeAndAnnoying, I'd want to be able to enter: hihaa 7hrs sleeping in the quick search box and an action of Create time entry ... would show up in the results. This would launch an intent and either just say Yay done or if it needs user intervention show a dialog / screen. So I guess I'd want to be able to say search hihaa anything should call Intent X and Intent X should be able to parse the query. Thanks, Danny. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] OpenGL and transparent PNG's
I'm having a problem with transparent 32-bit PNG's on both the emulator and the G1. They load fine, but I can't change their alpha value unless the texture is fully opaque to begin with. For a simple example: glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, fully_opaque_texture); // all pixels are opaque glColor4f(1, 1, 1, 0.5); glDrawArrays( ... ) // displays half transparency (correct) ... glBindTexture(GL_TEXTURE_2D, transparent_texture); // some pixels are transparent glColor4f(1, 1, 1, 0.5); glDrawArrays( ... ) // displays as fully opaque (wrong) I've also tried the following (as suggested on another thread) with no luck: setEGLConfigChooser(8, 8, 8, 8, 0, 0); getHolder().setFormat(android.graphics.PixelFormat.RGBA_); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Querying AlarmManager to determine if alarms are set
Hi there, does anyone know if its possible to query the AlarmManager to see if/what alarms are set? I can set an alarm using: AlarmManager am = (AlarmManager)getApplicationContext().getSystemService (Context.ALARM_SERVICE); Intent i = new Intent(getApplicationContext(), OnAlarmReceiver.class); PendingIntent pi=PendingIntent.getBroadcast(getApplicationContext(), 0, i, PendingIntent.FLAG_CANCEL_CURRENT); am.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), Const.UPDATE_INTERVAL_MS, pi); And i can then cancel it using: am.cancel(pi); But i can not figure out how to determine if the alarm is still set (e.g. so an activity can inform the user that the scheduled task is already set). AlarmManager has not isSet() method. Can anyone shed any light on this? Is it even possible? many thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: someone plz help me .. how to call built in camera app from my custom app ??
i got it right. I used this method and camera app executes. Intent intent = new Intent(); intent.setClassName(packageName, className); really thankful to u justin. Now next hurdle is that i want to run my decode function on the snap taken but after taking snap it remains in the camera app. so can i just break this app once the image is taken and how? so that i can then execute my function. On 10/8/09, wahib haq wahib.t...@gmail.com wrote: Dear Justin !! Thanks again as always. I understand your point. I'll try my best to work it out myself in future. I hope this time it works out. On 10/8/09, RichardC richard.crit...@googlemail.com wrote: In the SDK samples have a look at android-sdk-windows-1.6_r1\platforms\android-1.5\samples\ApiDemos\src \com\example\android\apis\graphics\CameraPreview.java On Oct 8, 10:43 am, wahib wahib.t...@gmail.com wrote: Hi !! I have a straightforward question. I just want to call and execute the built-in camera app i click button in my application. Being a newbie i have no idea how to code for it. plz share source code if anyone has done it. Regards, wahib -- Wahib-ul-haq Communications Engineering Student, NUST, Pakistan. www.sizzlotech.com -- Wahib-ul-haq Communications Engineering Student, NUST, Pakistan. www.sizzlotech.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Using the SAX parser in a static method
i am trying to parse an XML file using SAX. The problem is that I need to make the method Static because I want to run this method inside the onCreate methods of the DatabaseHelper class (Which is a static inner class). This is not really an android issue but a scope issue. The problem is at this line: XmlListHandler listXmlHandler = new XmlListHandler(); Eclipse shows me this error: No enclosing instance of type SpellDroidDbAdapter is accessible. Must qualify the allocation with an enclosing instance of type SpellDroidDbAdapter (e.g. x.new A() where x is an instance of SpellDroidDbAdapter). /* * Insert a List into the database from an XML file * * @param xmlFile a List XML file */ public static void insertNewListFromXML(File xmlFile) { try { /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML- Reader*/ XmlListHandler listXmlHandler = new XmlListHandler(); //Set the Handler xr.setContentHandler(listXmlHandler); // Parse the xml-data from our URL. xr.parse(xmlFile.getAbsolutePath()); } catch (Exception e) { /* Display any Error to the GUI. */ Log.e(TAG, List Insertion Error, e); //TODO display a toast to the user of the error } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Best way to reposition contents of ListView at the top?
I have a ListView which displays the results of some search. When the user makes a new search I repopulate the underlying Array of an ArrayAdapter and call notifyDataSetChanged(). However, if the user has previously scrolled down in the ListView then the scrolling is not then reset to the top - I can see why this is the way it is (to support incremental changes to the contents). How to programmatically set the contents to appear at the top of the ListView? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Best way to reposition contents of ListView at the top?
setSelection(0) On Thu, Oct 8, 2009 at 8:14 PM, westmeadboy westmead...@yahoo.co.uk wrote: I have a ListView which displays the results of some search. When the user makes a new search I repopulate the underlying Array of an ArrayAdapter and call notifyDataSetChanged(). However, if the user has previously scrolled down in the ListView then the scrolling is not then reset to the top - I can see why this is the way it is (to support incremental changes to the contents). How to programmatically set the contents to appear at the top of the ListView? -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Best way to reposition contents of ListView at the top?
Thanks. 1. Does this still work if the list is empty? The docs don't specify. 2. Is this better than just resetting the adapter? On Oct 9, 11:27 am, Romain Guy romain...@google.com wrote: setSelection(0) On Thu, Oct 8, 2009 at 8:14 PM, westmeadboy westmead...@yahoo.co.uk wrote: I have a ListView which displays the results of some search. When the user makes a new search I repopulate the underlying Array of an ArrayAdapter and call notifyDataSetChanged(). However, if the user has previously scrolled down in the ListView then the scrolling is not then reset to the top - I can see why this is the way it is (to support incremental changes to the contents). How to programmatically set the contents to appear at the top of the ListView? -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Best way to reposition contents of ListView at the top?
1. Does this still work if the list is empty? The docs don't specify. Yes. 2. Is this better than just resetting the adapter? Much much much much much more efficient. On Oct 9, 11:27 am, Romain Guy romain...@google.com wrote: setSelection(0) On Thu, Oct 8, 2009 at 8:14 PM, westmeadboy westmead...@yahoo.co.uk wrote: I have a ListView which displays the results of some search. When the user makes a new search I repopulate the underlying Array of an ArrayAdapter and call notifyDataSetChanged(). However, if the user has previously scrolled down in the ListView then the scrolling is not then reset to the top - I can see why this is the way it is (to support incremental changes to the contents). How to programmatically set the contents to appear at the top of the ListView? -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Best way to reposition contents of ListView at the top?
I notice that if setSelection(0) is called just before notifyDataSetChanged() it doesn't work - i.e. its as if setSelection (0) didn't do anything. However, switching the calls around works for me. On Oct 9, 11:49 am, Romain Guy romain...@google.com wrote: 1. Does this still work if the list is empty? The docs don't specify. Yes. 2. Is this better than just resetting the adapter? Much much much much much more efficient. On Oct 9, 11:27 am, Romain Guy romain...@google.com wrote: setSelection(0) On Thu, Oct 8, 2009 at 8:14 PM, westmeadboy westmead...@yahoo.co.uk wrote: I have a ListView which displays the results of some search. When the user makes a new search I repopulate the underlying Array of an ArrayAdapter and call notifyDataSetChanged(). However, if the user has previously scrolled down in the ListView then the scrolling is not then reset to the top - I can see why this is the way it is (to support incremental changes to the contents). How to programmatically set the contents to appear at the top of the ListView? -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] A question about MediaRecorder setAudioSource failed on the device?
Hi,all. The app I wrote doesn't run correctly on the device.Could someone give me a suggestion that how to solution this problem. The code is below. -- MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(/sdcard/test.amr); try { recorder.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block Log.e(Tag, IllegalStateException); e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block Log.e(Tag, IOException); e.printStackTrace(); } recorder.start(); The log is below. E/AndroidRuntime( 1441): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 1441): java.lang.RuntimeException: setAudioSource failed. E/AndroidRuntime( 1441):at android.media.MediaRecorder.setAudioSource (Native Method) E/AndroidRuntime( 1441):at com.android.RecorderTest.RecorderTest.RecoredInit(RecorderTest.java: 75) E/AndroidRuntime( 1441):at com.android.RecorderTest.RecorderTest.access$0(RecorderTest.java:73) E/AndroidRuntime( 1441):at com.android.RecorderTest.RecorderTest $1.onClick(RecorderTest.java:94) E/AndroidRuntime( 1441):at android.view.View.performClick(View.java: 2346) E/AndroidRuntime( 1441):at android.view.View.onTouchEvent(View.java: 4159) E/AndroidRuntime( 1441):at android.widget.TextView.onTouchEvent (TextView.java:6496) E/AndroidRuntime( 1441):at android.view.View.dispatchTouchEvent (View.java:3691) E/AndroidRuntime( 1441):at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:882) E/AndroidRuntime( 1441):at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:882) E/AndroidRuntime( 1441):at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:882) E/AndroidRuntime( 1441):at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:882) E/AndroidRuntime( 1441):at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:882) E/AndroidRuntime( 1441):at com.android.internal.policy.impl.PhoneWindow $DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) E/AndroidRuntime( 1441):at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1202) E/AndroidRuntime( 1441):at android.app.Activity.dispatchTouchEvent (Activity.java:2014) E/AndroidRuntime( 1441):at com.android.internal.policy.impl.PhoneWindow $DecorView.dispatchTouchEvent(PhoneWindow.java:1696) E/AndroidRuntime( 1441):at android.view.ViewRoot.handleMessage (ViewRoot.java:1626) E/AndroidRuntime( 1441):at android.os.Handler.dispatchMessage (Handler.java:99) E/AndroidRuntime( 1441):at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 1441):at android.app.ActivityThread.main (ActivityThread.java:4140) E/AndroidRuntime( 1441):at java.lang.reflect.Method.invokeNative (Native Method) E/AndroidRuntime( 1441):at java.lang.reflect.Method.invoke (Method.java:521) E/AndroidRuntime( 1441):at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) E/AndroidRuntime( 1441):at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:540) E/AndroidRuntime( 1441):at dalvik.system.NativeStart.main(Native Method) W/asset ( 1167): Asset path /data/app/RecorderTest.apk is neither a directory nor file (type=1). W/PackageManager( 1167): Failure retrieving resources forcom.android.RecorderTest --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Reverse Geocoding Example / Source Code
Hey folks, I've put together an example application that uses Google's reverse geocoding http service. If anyone is looking to use reverse geocoding, feel free to check it out. http://www.smnirven.com/?p=39 P.S. The complete source code is also there to download. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---