[android-beginners] Re: android media Apps
have you set Android SDK 1.5 in Eclipse? On Aug 20, 1:53 pm, nitin ni...@infocratsweb.com wrote: hello, I could not see Window/Android AVD Manager in Eclipse. I also tried to see it after running the application in emulator, how can I see it? could you please help? On Jul 23, 5:01 pm, Kacper86 cpph...@gmail.com wrote: In Eclipse click Window/Android AVD Manager. There you can create a new instance of emulator. If you want it to have a virtual SD Card then fill in the field SDCard (e.g. you can fill it with 64M). I'm not sure if you can add a new card to an existing emulator. On Jul 23, 10:42 am, atharva chauthaiwale atharva.c...@gmail.com wrote: Hi friends, I m trying to play a .mp3 file using MediaPlayer class on android emulator . I referred code from ApiDemos. It says that media file should be present on SD card. How do I emulate SD card on emulator? When I tried to run default media player application it says SD card not installed. Same error message I get while tryign to use camera. Thanks in advance for help :) Regards, Atharva --~--~-~--~~~---~--~~ 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: android media Apps
Hi, Sorry for delay, but I was on holidays :) 1. Debug any app and go to DDMS perspective. Then use File Explorer to pull or push files into device. 2. /sdcard On Jul 24, 5:56 am, atharva chauthaiwale atharva.c...@gmail.com wrote: Hi, �...@kacper86 Thanks for help... It worked. However, I have one more problem ... 1. How can I add media files on SD card? 2. What is the path of virtual SD card on local drives On Thu, Jul 23, 2009 at 5:31 PM, Kacper86 cpph...@gmail.com wrote: In Eclipse click Window/Android AVD Manager. There you can create a new instance of emulator. If you want it to have a virtual SD Card then fill in the field SDCard (e.g. you can fill it with 64M). I'm not sure if you can add a new card to an existing emulator. On Jul 23, 10:42 am, atharva chauthaiwale atharva.c...@gmail.com wrote: Hi friends, I m trying to play a .mp3 file using MediaPlayer class on android emulator . I referred code from ApiDemos. It says that media file should be present on SD card. How do I emulate SD card on emulator? When I tried to run default media player application it says SD card not installed. Same error message I get while tryign to use camera. Thanks in advance for help :) Regards, Atharva --~--~-~--~~~---~--~~ 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 Phone Book
Hi, You have to read this article: http://developer.android.com/guide/topics/providers/content-providers.html If you have any questions after the reading let us now :) On 5 Sie, 21:13, eNtriZe ajazahme...@gmail.com wrote: Hi, Iam beginner with android can any body tell me how i can access contents of phones Thanks, Regards --~--~-~--~~~---~--~~ 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: android media Apps
In Eclipse click Window/Android AVD Manager. There you can create a new instance of emulator. If you want it to have a virtual SD Card then fill in the field SDCard (e.g. you can fill it with 64M). I'm not sure if you can add a new card to an existing emulator. On Jul 23, 10:42 am, atharva chauthaiwale atharva.c...@gmail.com wrote: Hi friends, I m trying to play a .mp3 file using MediaPlayer class on android emulator . I referred code from ApiDemos. It says that media file should be present on SD card. How do I emulate SD card on emulator? When I tried to run default media player application it says SD card not installed. Same error message I get while tryign to use camera. Thanks in advance for help :) Regards, Atharva --~--~-~--~~~---~--~~ 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: Get file name from Uri
Hi, The problem is that it should be documented in the Android Reference, here: http://developer.android.com/reference/android/provider/MediaStore.Images.html http://developer.android.com/reference/android/provider/MediaStore.Images.ImageColumns.html But, as far as i understand, it's not complete. Fortunately, we can check it in a different way. android code Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; //sdcard only Cursor c = managedQuery(u, null, null, null, null); if (c.moveToFirst()) { do { int max = c.getColumnCount(); for (int i = 0; i max; i++) { String colName = c.getColumnName(i); String value = c .getString(c.getColumnIndex(colName)); if (colName != null){ Log.d(columnName: , colName); } if (value != null) { Log.d(value, value); } } } while (c.moveToNext()); } /android code Check LogCat and you'll notice that we have all column names with their values. I suppose, you'd be interested in: 07-22 12:50:09.973: DEBUG/columnName:(3049): _data 07-22 12:50:09.973: DEBUG/value(3049): /sdcard/download/vienna-s- schonbrunn-zoo-and-giant-ferris-wheel-in-vienna-1.jpg (...) 07-22 12:50:09.983: DEBUG/columnName:(3049): _display_name 07-22 12:50:09.983: DEBUG/value(3049): vienna-s-schonbrunn-zoo-and- giant-ferris-wheel-in-vienna-1.jpg If you have got any questions, don't hesitate to ask. Greetings! On Jul 22, 10:28 am, Mina Shokry minasho...@gmail.com wrote: Hello, I am using content provider to access images in phone gallery and everything works fine except one thing that I want to get the physical file name of images I access. Can I get a java.io.File object from android.net.Uri object? if no, is there any other way to accomplish such a task? I just need to know the file name! --~--~-~--~~~---~--~~ 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: a question about final variable and multiple constructors
Hi First of all, your code is a mess, and you shouldn't attach such snippets. Please be more careful, and make sure it'd be easy to read and compile. If it's not possible to compile then at least eliminate the most basic errors (e.g. mHandleId has no type, there is no class declaration etc.). Then, there is no x field in your code ;) Now, to the point. You can declare blank (without value) finals, but then all constructors MUST initialize it. This is a Java rule. So, either initialize it in all constructors, or remove the first two of them [constructors] if not needed. On Jul 22, 3:06 pm, nikki nikki_...@pegatroncorp.com wrote: Hi I ran into a compiler error saying The blank final field x may not have been initialized while I was extending ViewGroup to make another UI thing by modifying SlidingDrawer. The fact is I'd already assigned some value to my final variable in the 3rd constructor from ViewGroup, and I left the 1st and 2nd constructors nothing but the auto-genned super()s. But for some reason this error only showed up at the 1st constructor. And if I commented out the first constructor, the error will just disappear instead of complaining about my empty 2nd constructor. I'm new to Java and Eclipse, so not sure if this is a Java or Android thing, hope somebody stump upon here happens to have some clue :) BTW my code: private final mHandleId; private final mContentId; public DeckView(Context context) { super(context); // TODO Auto-generated constructor stub } public DeckView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public DeckView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); TypedArray a = context.obtainStyledAttributes (attrs,R.styleable.DeckView,defStyle,0); int orientation = a.getInt (R.styleable.SlidingDrawer_orientation, ORIENTATION_HORIZONTAL); mVertical = orientation == ORIENTATION_HORIZONTAL; mBottomOffset=(int)a.getDimension (R.styleable.SlidingDrawer_bottomOffset, 0.0f); mTopOffset=(int)a.getDimension (R.styleable.SlidingDrawer_topOffset,0.0f); mAllowSingleTap=a.getBoolean (R.styleable.SlidingDrawer_allowSingleTap, true); int handleID = a.getResourceId (R.styleable.SlidingDrawer_handle, 0); if(handleID == 0) { throw new IllegalArgumentException(The handle attribute is required and must refer to a valid child); } int contentID = a.getResourceId (R.styleable.SlidingDrawer_content, 0); if(contentID == 0) { throw new IllegalArgumentException(The content attribute is requried and must refer to a valid child); } mHandleId = handleID; mContentId = contentID; a.recycle(); setAlwaysDrawnWithCacheEnabled(false); } 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: Get file name from Uri
Hi, Firstly, I'd like to recommend this article: http://developer.android.com/guide/topics/providers/content-providers.html Secondly, let's solve your problem (which you can solve on your own after reading the article). The Uri is not supposed to carry a large amount of data. You don't cast it to huge objects and directly query it for the information. Think of it as an address. When you have an address and a mean of transport you can get there and find whatever you're looking for. To the point, if you have an Uri, you can use Cursor and make a proper query, which can look like this: android code Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; Uri u2 = Uri.withAppendedPath(u, 1); // this is what you have // u2 == content://media/external/images/media/1 String[] projection = { MediaStore.Images.ImageColumns.DATA, / *col1*/ MediaStore.Images.ImageColumns.DISPLAY_NAME /*col2*/}; Cursor c = managedQuery(u2, projection, null, null, null); if (c!=null c.moveToFirst()) { String column0Value = c.getString(0); String column1Value = c.getString(1); Log.d(Data,column0Value); Log.d(Display name,column1Value); } /android code Obviously, you can reduce number of columns to the one you need the most. The less number of columns we have to return, the more efficient it will get. On Jul 22, 8:41 pm, Mina Shokry minasho...@gmail.com wrote: thank you for this great help but unfortunately this isn't my case. not me who created the cursor and iterate through it. I am just receiving the Uri from another activity via an intent. and it isn't good to iterate through all images to find one its Uri matches one I received especially that I am not sure it will always be a Uri of an image. still can I get the file name? On Jul 22, 4:04 pm, Kacper86 cpph...@gmail.com wrote: Hi, The problem is that it should be documented in the Android Reference, here: http://developer.android.com/reference/android/provider/MediaStore.Im.. But, as far as i understand, it's not complete. Fortunately, we can check it in a different way. android code Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; //sdcard only Cursor c = managedQuery(u, null, null, null, null); if (c.moveToFirst()) { do { int max = c.getColumnCount(); for (int i = 0; i max; i++) { String colName = c.getColumnName(i); String value = c .getString(c.getColumnIndex(colName)); if (colName != null){ Log.d(columnName: , colName); } if (value != null) { Log.d(value, value); } } } while (c.moveToNext()); } /android code Check LogCat and you'll notice that we have all column names with their values. I suppose, you'd be interested in: 07-22 12:50:09.973: DEBUG/columnName:(3049): _data 07-22 12:50:09.973: DEBUG/value(3049): /sdcard/download/vienna-s- schonbrunn-zoo-and-giant-ferris-wheel-in-vienna-1.jpg (...) 07-22 12:50:09.983: DEBUG/columnName:(3049): _display_name 07-22 12:50:09.983: DEBUG/value(3049): vienna-s-schonbrunn-zoo-and- giant-ferris-wheel-in-vienna-1.jpg If you have got any questions, don't hesitate to ask. Greetings! On Jul 22, 10:28 am, Mina Shokry minasho...@gmail.com wrote: Hello, I am using content provider to access images in phone gallery and everything works fine except one thing that I want to get the physical file name of images I access. Can I get a java.io.File object from android.net.Uri object? if no, is there any other way to accomplish such a task? I just need to know the file name! --~--~-~--~~~---~--~~ 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 the text value that has been entered in a dialog box?(AlertDialog)
Hi, These are my first steps in Android, so my solution might not be perfect, yet it works. First of all, you should create a member in AlertDialogSamples class: private int dialogSingleChoiceOption=0; //0, because Map is the default choice Secondly, you have to act when somebody clicks on the dialog: /* User clicked on a radio button do some stuff */ dialogSingleChoiceOption = whichButton; Finally, to read the result when sb clicks OK: /* User clicked Yes so do some stuff */ String[] strArr = getResources().getStringArray (R.array.select_dialog_items2); String result = strArr[dialogSingleChoiceOption]; Log.d(!Result,result); I recommend these two links: http://developer.android.com/guide/topics/resources/resources-i18n.html http://developer.android.com/guide/topics/resources/available-resources.html Any questions? On Jul 21, 7:16 am, daum3...@yahoo.com daum3...@yahoo.com wrote: Hello all, I'm playing with the AlertDialogSample.java program. I want to add lines in the code to get the value in the onClick methods. Please see the location marked as == that I want to add lines. Could you please guide me what lines should be there? Thank you. case DIALOG_SINGLE_CHOICE: return new AlertDialog.Builder(AlertDialogSamples.this) .setIcon(R.drawable.alert_dialog_icon) .setTitle(R.string.alert_dialog_single_choice) .setSingleChoiceItems(R.array.select_dialog_items2, 0, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked on a radio button do some stuff */ } }) .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked Yes so do some stuff */ = = } }) .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked No so do some stuff */ } }) .create(); case DIALOG_MULTIPLE_CHOICE: --~--~-~--~~~---~--~~ 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: Android beginners
it's a common problem. you have to delete these 3 files (on linux they are hidden) that are causing the problem and refresh your project. On 17 Mar, 23:42, MMC2 m...@mmc2.com.au wrote: NOTEPADV1 To Mike Garcia or anyone else who can shed light onto my problem. I want to run the tutorial app Notepadv1Solution but I get errors and it won't run. Thanks for your reply. I am using version android-sdk-windows-1.1_r1 of the SDK. I wasn't able to cut and paste the problem descriptions, but here they are DESCRIPTION RESOURCE PATH LOCATION TYPE Invalid character constant ._Notepadv1.java Notepadv1/src/com/android/demo/notepad1 line 1 Java Problem Syntax error on tokens, delete these tokens ._Notepadv1.java Notepadv1/src/com/android/demo/notepad1 line 1 Java Problem Syntax error on tokens, delete these tokens ._NotesDbAdapter.java Notepadv1/src/com/android/demo/notepad1 line 1 Java Problem Syntax error on tokens, delete these tokens ._R.java Notepadv1/src/com/android/demo/notepad1 line 1 Java Problem I can't see where these errors are. I don't know what the tokens are and I cannot work out how to display the line numbers. Many thanks if you can help. MMC2 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---