[android-developers] RecyclerView with GridLayoutManager, end of list issue
while using recycler view with grid layout manager, how to know if user has scrolled to the end of list ? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/6151f0fa-7a8f-4f7d-a131-3b202cf65d81%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Store Video Url in cache before play
Hello buddies, I am facing problem in video play from url. when i play video from url it takes to much time to play and i have to play multiple videos on swipe in video view. So is it possible to store video in cache when first video is playing at that time second video store in cache. Give some suggestion to me so it would be helpful. Thanks... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/4a4af008-d38e-4ce2-b977-9e1ea2e8e9db%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: lockNow() API throws error on a few LG phones
anyone? On Jan 30, 3:55 pm, Priyank priyankvma...@gmail.com wrote: Hi, I am trying to use the lockNow() method from the DevicePolicyManager. It works fine for most of the phones I have tested. But on a couple of LG phones, the method is throwing a null pointer exception. The LG phones I am getting this error are: LG Vortex(Android Version 2.2.2) LG Enlighten (Android Version 2.3.4). I also saw this post with a similar problem sometime back but no positive answers to it: http://groups.google.com/group/android-developers/browse_thread/threa... Could someone help me with this. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] lockNow() API throws error on a few LG phones
Hi, I am trying to use the lockNow() method from the DevicePolicyManager. It works fine for most of the phones I have tested. But on a couple of LG phones, the method is throwing a null pointer exception. The LG phones I am getting this error are: LG Vortex(Android Version 2.2.2) LG Enlighten (Android Version 2.3.4). I also saw this post with a similar problem sometime back but no positive answers to it: http://groups.google.com/group/android-developers/browse_thread/thread/143a82414151e129 Could someone help me with this. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] RegisterBroadcastReceiver in Manifest.xml
Hi, I am trying to register a callback when a get a call on my phone. Here is what I am doing: public class BroadcastActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public class Receiver1 extends BroadcastReceiver { public void onReceive(Context context,Intent intent) { System.out.println(this + :GOT-THE-INTENT); //-emulator-doesn't-support-vibration- Vibrator v = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(500); } } } This is my Manifest file: application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.BroadcastActivity android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity receiver android:name=com.broadcast.BroadcastActivity.Receiver1 android:enabled=true android:exported=true intent-filter action android:name=android.intent.action.PHONE_STATE/action /intent-filter /receiver /application I am getting Unable to instantiate receiver com.broadcast.BroadcastActivity.Receiver1: java.lang.ClassNotFoundException: com.broadcast.BroadcastActivity.Receiver1 in loader dalvik.system.PathClassLoader[/data/app/com.broadcast-2.apk] error. I would like to receive a callback even when the application is not open. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: RegisterBroadcastReceiver in Manifest.xml
Thanks for the reply. The 2 changes you mentioned made it work. But the problem now I am facing is that, I cannot call a method which belongs to the main class(BroadcastActivity ) from onReceive() since the Receiver1 class is static. Is there any way to deal with this. The reason I can not put the Receiver1 class in a different java file is that there are many UI changes I do when I receive the broadcast. Thanks again. Priyank On Nov 8, 1:52 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Then you'd have to do two things: - Make Receiver1 a static class: public *static *class Receiver1 extends BroadcastReceiver If not, instances of Receiver1 cannot be instantiated without an enclosing BroadcastActivity instance. - Change the name in your manifest to com.broadcast.BroadcastActivity*$* Receiver1 I would put Receiver1 in its own java file, though... then you won't have to worry about the bullet-points mentioned above. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: RegisterBroadcastReceiver in Manifest.xml
Hi, I had tried initially by dynamically using registering the receivers using the registerReceiver(). I get the callback when I the application is in the foreground. The problem I faced was that, when I exit the application, I never got a callback on the receiver when I try to trigger it from my service class. From my service, I call: Intent intent=new Intent(Consts.INTENT_UPDATE); this.sendBroadcast(intent); My receiver in my Activity class looks like this: private BroadcastReceiver updateReceiver=new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub if(Consts.INTENT_UPDATE.equals(intent.getAction())) { update(); } } }; I do not unregister my receivers at onDestroy() and register during onCreate(). Is there something I am missing. Thanks, Priyank On Nov 8, 3:13 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Nov 8, 2011 at 2:45 PM, Priyank priyankvma...@gmail.com wrote: Thanks for the reply. The 2 changes you mentioned made it work. But the problem now I am facing is that, I cannot call a method which belongs to the main class(BroadcastActivity ) from onReceive() since the Receiver1 class is static. Is there any way to deal with this. Not the way you're going about the problem. The reason I can not put the Receiver1 class in a different java file is that there are many UI changes I do when I receive the broadcast. You will not be doing any changes to the UI when you receive the broadcast. If you wanted to do that, you would not be using a manifest-registered receiver. Use registerReceiver() in the activity to register a BroadcastReceiver dynamically; that receiver can then work with the activity to update the UI. For example, here is an application that uses ACTION_BATTERY_CHANGED this way: https://github.com/commonsguy/cw-advandroid/tree/master/SystemEvents/... -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training in NYC:http://marakana.com/training/android/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: setRoaming in ServiceState
anyone? On Oct 20, 4:16 pm, Priyank priyankvma...@gmail.com wrote: Hi, I was trying to set data roaming on my phone programmatically. But when I try to do it using the setRoaming method available in the ServiceState class, I dont see the change take place on my phone. I am doing something like this: ServiceState serviceState = new ServiceState(); serviceState.setRoaming(true); Kindly let me know if I am missing something here. Thanks. Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: setRoaming in ServiceState
anyone? On Oct 20, 4:16 pm, Priyank priyankvma...@gmail.com wrote: Hi, I was trying to set data roaming on my phone programmatically. But when I try to do it using the setRoaming method available in the ServiceState class, I dont see the change take place on my phone. I am doing something like this: ServiceState serviceState = new ServiceState(); serviceState.setRoaming(true); Kindly let me know if I am missing something here. Thanks. Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] setRoaming in ServiceState
Hi, I was trying to set data roaming on my phone programmatically. But when I try to do it using the setRoaming method available in the ServiceState class, I dont see the change take place on my phone. I am doing something like this: ServiceState serviceState = new ServiceState(); serviceState.setRoaming(true); Kindly let me know if I am missing something here. Thanks. Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Enabling/Disabling features in Andorid
I would like to know if these features can be turned on/off (or block) from an application.. I am trying to build a security related application. 1. Camera 2. Tethering 3. USB 4. Data Roaming. 5. Installing non-market apps. 6. Mobile access points I was able to enable/disable Bluetooth and WiFi. Any help on this would be great.. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Enabling/Disabling features in Andorid
Thanks for the reply.. I understand that blocking could be a security issue. But enabling/ disabling should not be a problem. For example, if the app disables the 'installing non-market apps feature from my app, the user can go to settings and enable it back. Something like this would do.. Coz I know that this is possible for bluetooth n wifi.. The application could be the device admin if needs to.. Thanks, Priyank On Oct 6, 2:01 pm, Kristopher Micinski krismicin...@gmail.com wrote: On Thu, Oct 6, 2011 at 1:30 PM, Priyank priyankvma...@gmail.com wrote: I would like to know if these features can be turned on/off (or block) from an application.. I am trying to build a security related application. 1. Camera 2. Tethering 3. USB 4. Data Roaming. 5. Installing non-market apps. 6. Mobile access points I was able to enable/disable Bluetooth and WiFi. Any help on this would be great.. Thanks, Priyank Priyank, You can't ``block'' these resources to the rest of the system. However, you can remove a permission from any given app and block it from that app. But I think the answer to your question is no, you can't block access to other apps from your app, this would be a big security hole indeed if you could. Kris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android:allowClearUserData=false
Thanks for the reply. I wanted to do something similar. I wanted to save some information on the phone, but when the user selects Clear Data, the information needs to persist. I dont mind the information getting deleted if the user uninstalls the application. I tried saving the information in a file in the internal memory (data/ data/com.test/files/FILENAME using openFileOutput(FILENAME, Context.MODE_PRIVATE)) but still the file gets deleted on pressing Clear Data. I do not want to save the file in the SD card. Is there any way I can do that. Any help would be appreciated. Thanks, Priyank On Jul 26, 1:24 pm, Chris Stratton cs07...@gmail.com wrote: On Tuesday, July 26, 2011 1:17:42 PM UTC-4, Priyank wrote: I saw a few posts which said that even though we add this line in the manifest file, we are not able to disable the Clear Data button for an application. I tried it in 2.2, 2.3 and 3.0 and was not able to disable that button. Am I doing anything wrong or is there any other method to do this. Apparently that was only ever available for system applications, and is also broken in some versions. This would be consistent with the android design goal of not letting 3rd party apps make semi-permanent changes to the device. Even if it did work, removing and re-installing the application would get around it. See:https://groups.google.com/d/msg/android-developers/sQkfGQ9zVrc/AT98os... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] android:allowClearUserData=false
Hi, I saw a few posts which said that even though we add this line in the manifest file, we are not able to disable the Clear Data button for an application. I tried it in 2.2, 2.3 and 3.0 and was not able to disable that button. Am I doing anything wrong or is there any other method to do this. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Web based Emulator
Hi, I would like to know if we could launch an emulator on the web, so that we can use this emulator anywhere as long as we have internet connection. It would be great if anyone could share some light on this. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Web based Emulator
I would like to access the emulator from some other system at a different location where I do not have anything installed. So I was thinking if we can upload the emulator image into some server and then try to access it using some web based tool. Is this possible ? I am trying to do something like this which is there for T-Mobile G1, but i think it has been done using Flash: http://tmobile.modeaondemand.com/htc/g1/ http://tmobile.modeaondemand.com/htc/g1/Thanks, Priyank On Thu, Apr 21, 2011 at 3:01 PM, Mark Murphy mmur...@commonsware.comwrote: On Thu, Apr 21, 2011 at 3:30 PM, Priyank priyankvma...@gmail.com wrote: I would like to know if we could launch an emulator on the web, so that we can use this emulator anywhere as long as we have internet connection. No. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.0 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Using Fragmentation to navigate from one activity to another
Hi, I wanted to use fragmentation in my application. Here is the scenario. There are 2 vertical fragments. The 1st fragment have buttons and second fragment have screens that need to be displayed according to the button pressed in the 1st fragment. I have implemented this using the help of the android sample examples . But now, in the 2nd fragment as well there are buttons which on clicking, we need to navigate in this fragment from one activity(xml) to another(xml) within the 2nd fragment. That is the 1st fragment is always visible to the user. I have multiple xmls which need to be navigated from one screen to another on click of buttons. But these screens needs to be there only in the 2nd fragment as the 1st fragment should always show same buttons from the beginning. This is my code of my 2nd fragment class. Here the entire screen is occupied by the activity when i click on the button. public static class DetailsFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = (View) inflater.inflate(R.layout.testscreen, null); Button b = (Button)v.findViewById(R.id.button1); b.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { displayNextScreen(); } }); return v; } private void displayNextScreen() { Intent intent = new Intent(getActivity(),NextActivity.class); startActivity(intent); } } Please help.. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] google application not visible when I build my emulator
Hi, I have written a customized application using google maps. So I had to generate the API key and add it into my xml file. The application works perfectly fine when I run it on my emulator using eclipse. But since I was making my customized emulator, I downloaded the android source code and built an image using this apk file. But I am not able to see this application when I run the image file that was built. Is this got to do something with google and the API keys ? Please help. I have tested other apk files by building an image with them, which works perfectly fine. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Linkify
Hi, Thanks for the reply.. I am trying to do what you said. I defined a string: string name= support_requestSupport Request: a href= supp...@unl.com?subject=commentssupp...@unl.com/a/string In my .java code, I created a textview and called the setMovementmethod like this: TextView emailLink; emailLink = (TextView) this.findViewById(R.id.support_request); emailLink.setMovementMethod(LinkMovementMethod.getInstance()); I am getting the error below when I run the app and click on the email text: 11-01 02:44:42.431: ERROR/AndroidRuntime(1870): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=supp...@unl.com?subject=comments(has extras) } I think I am missing something in the manifest file. I am not sure what I need to fill there. Whar do I enter in the data field in the intent filter? Here is my intent filter I have defined in the corresponding activity: intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT/ category android:name=android.intent.category.BROWSABLE/ data android:scheme=http android:host=supp...@unl.com/ /intent-filter I think I am doing something wrong here. Please Help. Thanks, Priyank On Sat, Oct 30, 2010 at 7:31 PM, Lance Nanek lna...@gmail.com wrote: I haven't gotten autoLink/Linkify to work with subjects, but I have used explicit mailto href values that included the subject parameter in TextView views successfully. The way I did it the string in the strings XML has a literal anchor tag in it with the mailto href including a subject parameter. I set the string via the text attribute on the TextView in XML and the HTML link gets converted properly. Then I also call: setMovementMethod(LinkMovementMethod.getInstance()); On the TextView from code. The amount of HTML a TextView will parse is limited, but apparently it is enough for mailto links with subject parameters, at least. On Oct 30, 5:55 pm, Priyank priyankvma...@gmail.com wrote: Hi, I am stuck at a place when I was using Linkify to create Link an email id to the Android email app. I have a large sentence in a textview which has an email id. On clicking on it, it opens my android email app. But The problem is that, I cannot add any subject or message in the mail. Is there any way of doing this using linkify ? Or do I have to use any other way for doing this. I initially used a textview which had just the email id, from which I could add the subject and message, but i will have to keep the email id in a separate line. I want the entire line in the textview where the email id comes in the middle of the sentence. I am currently doing like this: TextView emailLink; emailLink = (TextView) this.findViewById(R.id.support_request); Linkify.addLinks(emailLink,Linkify.EMAIL_ADDRESSES); Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Linkify
Hi, I am stuck at a place when I was using Linkify to create Link an email id to the Android email app. I have a large sentence in a textview which has an email id. On clicking on it, it opens my android email app. But The problem is that, I cannot add any subject or message in the mail. Is there any way of doing this using linkify ? Or do I have to use any other way for doing this. I initially used a textview which had just the email id, from which I could add the subject and message, but i will have to keep the email id in a separate line. I want the entire line in the textview where the email id comes in the middle of the sentence. I am currently doing like this: TextView emailLink; emailLink = (TextView) this.findViewById(R.id.support_request); Linkify.addLinks(emailLink,Linkify.EMAIL_ADDRESSES); Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] opening Android Email application from another application
Hi, I have my application which creates an audio file. I need to forward this file via Android Email app. But on calling the email intent, I get a permission denial. I am calling the email app like this: Uri emailUri = Uri.parse(content://com.android.email.provider/ account); Cursor cursor = mCr.query(emailUri, null, null, null, null); I get an exception : java.lang.SecurityException: Permission Denial: reading com.android.email.provider.EmailProvider uri content://com.android.email.provider/account from pid=1721, uid=10031 requires com.android.email.permission.ACCESS_PROVIDER I have set the email permission in my Manifest file: uses-permission android:name=com.android.email.permission.ACCESS_PROVIDER/uses- permission When I am launching the app, I get this Not granting access message in the ddms logs: WARN/PackageManager(90): Not granting permission com.android.email.permission.ACCESS_PROVIDER to package com.mplayer.application (protectionLevel=3 flags=0xbe44) Can I not open the android email app from my application. I am working on Android 2.2 Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] opening Android Email application from another application
Hi, Thanks for your reply. What you said worked. Instead of querying the email provider, I directly called the intent: emailIntent.setClassName(com.android.email, com.android.email.activity.Welcome); startActivity(emailIntent); But my doubt is that, I dont know whether the user has configured his email or not. i.e whether to call the Welcome activity or MessageCompose activity of the email application. Because of this, I thought of querying the email app and if there is an account, I will start the MessageCompose activity. Is there any other way of doing this ? Thanks again. your suggestion really helped. Priyank On Wed, Oct 6, 2010 at 1:43 PM, Kumar Bibek coomar@gmail.com wrote: You can open the Activity(Compose) of the mail app. But the content provider for the gmail app is not public. So, you cannot query that content provider. If you want to send an audio file as an attachement, checkout the SEND action. http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND On Thu, Oct 7, 2010 at 12:09 AM, Priyank priyankvma...@gmail.com wrote: Hi, I have my application which creates an audio file. I need to forward this file via Android Email app. But on calling the email intent, I get a permission denial. I am calling the email app like this: Uri emailUri = Uri.parse(content://com.android.email.provider/ account); Cursor cursor = mCr.query(emailUri, null, null, null, null); I get an exception : java.lang.SecurityException: Permission Denial: reading com.android.email.provider.EmailProvider uri content://com.android.email.provider/account from pid=1721, uid=10031 requires com.android.email.permission.ACCESS_PROVIDER I have set the email permission in my Manifest file: uses-permission android:name=com.android.email.permission.ACCESS_PROVIDER/uses- permission When I am launching the app, I get this Not granting access message in the ddms logs: WARN/PackageManager(90): Not granting permission com.android.email.permission.ACCESS_PROVIDER to package com.mplayer.application (protectionLevel=3 flags=0xbe44) Can I not open the android email app from my application. I am working on Android 2.2 Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Recording Audio in Emulator
Hi, I am facing some problem when I try to run record an audio. In my startRecord() method, this is what I do: recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(outputfileformat); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(path); The logs throw a audio_input error in this line: recorder.setAudioSource(MediaRecorder.AudioSource.MIC); The error is: 09-09 19:04:02.696: ERROR/audio_input(34): unsupported parameter: x- pvmf/media-input-node/cap-config-interface;valtype=key_specific_value 09-09 19:04:02.696: ERROR/audio_input(34): VerifyAndSetParameter failed I am using a microphone connected to my pc to record the audio. I am working on eclipse in windows xp. I was wondering whether this is because my PC microphone is not configured with the emulator ? I have seen a similar thread regarding this issue. I have configured the SD card and have set the path to the sdcard location. What is the command i need to give to configure my microphone to the emulator? emulator.exe -audio winaudio @androidvmdoesnt seem to work. Someone please help. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MediaPlayer Error (1,-1004)
Hi, I am getting an error (1,-1004) when i try to play a .amr file. The file is about 15 seconds long and after playing for about 4 seconds, it stops and I get this error. I am making the calls just as mentioned in the docs.. MediaPlayer mp = new MediaPlayer(); mp.setDataSource(PATH_TO_FILE); mp.prepare(); mp.start(); Could anyone please help me out here. Is there any documentation related to Media player errors.. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: MediaPlayer Error (1,-1004)
I just found my mistake. It was the file that was faulty. I tried opening it in a amr player and the same thing was happening. But in general, is there any doc so that we come to know the meaning of the error codes. Thanks, Priyank On Thu, Aug 26, 2010 at 10:47 AM, Priyank priyankvma...@gmail.com wrote: Hi, I am getting an error (1,-1004) when i try to play a .amr file. The file is about 15 seconds long and after playing for about 4 seconds, it stops and I get this error. I am making the calls just as mentioned in the docs.. MediaPlayer mp = new MediaPlayer(); mp.setDataSource(PATH_TO_FILE); mp.prepare(); mp.start(); Could anyone please help me out here. Is there any documentation related to Media player errors.. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Starting an Activity from a callback class
I was able to fix the problem. The issue was that i did not have the context instance in my callback class. I created a constructor where I got the context from the service class. Using that I was able to call the application activity class. Also I had to use myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); for starting the task.. This was my constructor in the callback class private VServiceCallBack(Context iContext) { context = iContext; } And according to the arguments received, { Intent appView = new Intent(context, AppView.class); appView .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(appView ); } Sorry for the confusion, and thanks for the help.. Priyank On Thu, Aug 19, 2010 at 5:34 PM, Indicator Veritatis mej1...@yahoo.comwrote: Treking is right: you are simply not posting enough information. And what you have posted is problematic and misleading: what do you MEAN the application 'closes'? Have you really missed all the heated discussions explaining why developers should not close/exit their own application components, but leave that to the system to do? On Aug 18, 12:58 pm, Priyank priyankvma...@gmail.com wrote: Hi, I have an activity class(Application Class ) which calls a service class(Service Class) and closes. The service class takes about 5 seconds to complete its task and calls a method which is present in another class(Callback Class). Now according to the result, the callback needs to notify the Application class. Once i get the callback from the service, I tried calling a method defined in the Application class. In this method i create a new intent of Application class and call startActivity(Application Class). But this is not working. Can anyone tell where i am going wrong and what can I do to solve this issue. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Starting an Activity from a callback class
Hi, I have an activity class(Application Class ) which calls a service class(Service Class) and closes. The service class takes about 5 seconds to complete its task and calls a method which is present in another class(Callback Class). Now according to the result, the callback needs to notify the Application class. Once i get the callback from the service, I tried calling a method defined in the Application class. In this method i create a new intent of Application class and call startActivity(Application Class). But this is not working. Can anyone tell where i am going wrong and what can I do to solve this issue. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Extending multiple classes
Thanks guys for the quick response. Will try it out and let you know Thanks Priyank On Fri, Jul 30, 2010 at 12:38 PM, Mark Murphy mmur...@commonsware.comwrote: On Fri, Jul 30, 2010 at 1:29 PM, Priyank priyankvma...@gmail.com wrote: Can my class extend 2 or more classes at a time. No, sorry. I want to extend Activity as well as Application. Even if that were possible, I doubt this would be a good idea. Activity because, I need to do a couple of things during the onCreate() [binding a service]and Application, because I am creating objects of another class [service class]which needs to be accessible throughout my application. Use a service, static data members, or a separate custom Application class. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Extending multiple classes
Hi, I had a basic question. Can my class extend 2 or more classes at a time. What is the syntax. I want to extend Activity as well as Application. Wont this create problems in the manifest file? Activity because, I need to do a couple of things during the onCreate() [binding a service]and Application, because I am creating objects of another class [service class]which needs to be accessible throughout my application. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Extending multiple classes
Hi, I am facing some when running the code. I am using the getApplicationContext() to save the instance. Kindly have a look at my code and let me know where I am going wrong. VVMService is the class whose instance is created and got from the onServiceConnected() callback public class VVMServiceBind extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); bindService(new Intent(VVMServiceBind.this, VVMService.class), mConnection, Context.BIND_AUTO_CREATE); VVMService appState = ((VVMService)getApplicationContext()); } public void onServiceConnected(ComponentName className, IBinder service) { Log.i(TAG, In onServiceConnected); mService = ((VVMService.VVMBinder)service).getService(); appState = mService; } } VVMClientApplication is the class where I need to access the VVMService class instance. public void serviceConnectionSuccess() { private VVMService mService; mService = (VVMService)getApplicationContext(); } dont I have to extend Application in any class ? Thanks, Priyank On Fri, Jul 30, 2010 at 12:45 PM, Shane Isbell shane.isb...@gmail.comwrote: Just invoke Activity.getApplication() within your Activity.onCreate method, casting the Application to your specific class type. Then your can set whatever you need on your application instance and it will be accessible within other Activities through the same Activity.getApplication() method. http://developer.android.com/reference/android/app/Activity.html#getApplication On Fri, Jul 30, 2010 at 10:29 AM, Priyank priyankvma...@gmail.com wrote: Hi, I had a basic question. Can my class extend 2 or more classes at a time. What is the syntax. I want to extend Activity as well as Application. Wont this create problems in the manifest file? Activity because, I need to do a couple of things during the onCreate() [binding a service]and Application, because I am creating objects of another class [service class]which needs to be accessible throughout my application. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Shane Isbell (Founder of ZappMarket) http://apps.facebook.com/zappmarket/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Multiple Back Button clicks needed to exit application
Hi, In my current application design, I have an activity class application.java (which starts on launching the application), and it does not have a layout(UI screen). I call another class called servicebind.java from the onCreate method of my 1st class. here I bind to the local server (bindServer()). i call back the application class through an intent. Once I am back to my application class, I call my activity class called welcome.java which has a layout/UI. When I run this application, I am able to see the welcome screen. But the problem is, when I click on the back button, I get a black screen with just the title on top. I have to hit back button 3 times to exit the application. The reason I see from the logs is that, the 1st 2 activity classes (application.java and services.java) does not get destroyed unless I hit the back button. So the 1st time I hit back button, the welcome activity gets destroyed. the next back button destroys the servicebind class and final back destroys the application class. Is the reason because these classes dont have a UI to display in the onCreate method. I do not want to change my design where I bind the service in the servicebind class and call the welcome activity in the application class. can anyone please help me find a way to avoid pressing the back button multiple times to exit. Please let me know if you dont understand my question. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Tool to generate class diagrams
Hi, I have an existing android project, which I want to view it as a class diagram or in any uml representation Could anyone please give me a free tool to generate them. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Tool to generate class diagrams
Hi, Thanks a lot for your reply. I installed ArgoUML and am trying to figure how to use it. My project doesnt have a XMI file to import from. It consists of 2 modules. Application and Services. Each of them has 3-4 packages having about 15 .java files and a few resource files. I tried to do Import Sources in ArgoUML and selected the entire project. But I was not able to understand how to go ahead. Which perspective is the best to use in this scenario. Could you please tell me what I am doing is the right way. Or am I missing something . Thanks, Priyank On Mon, Jul 5, 2010 at 3:31 PM, Fred Grott(Android Expert, http://mobilebytes.wordpress.com) fred.gr...@gmail.com wrote: Hi Priyank, ArgoUML it also has an eclipse plugin and Papyrus Eclipse Modeling project Eclipse 3.6. On Jul 5, 2:55 pm, Priyank priyankvma...@gmail.com wrote: Hi, I have an existing android project, which I want to view it as a class diagram or in any uml representation Could anyone please give me a free tool to generate them. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Error in accessing java file genetated from .aidl file
Hi, I am trying to launch an existing project which has 2 parts. Services module and Application module. The VMService.aidl file is in a package in the service module. When the service module is compiled, the generated VMService.java file appears in the /gen folder. I have exported this in the source code of the application as import com.VMService; But I am still getting run time errors during the launch of the application. The LogCat logs show this: Could not find class com.VMService 06-30 17:33:11.248: ERROR/dalvikvm(460): Could not find class 'com.VVMService', referenced from method com.vmapp.VMApplication.onActivityResult 06-30 17:33:11.457: ERROR/AndroidRuntime(460): java.lang.NoClassDefFoundError: com.VMService Please let me know where I am going wrong. Thanks, Priyank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to access a AIDL service from different packages?
Hi, I am kind of facing a similar problem with my project. I have an existing project which has 2 parts. Services module and Application module. The VMService.aidl file is in a package in the services. When the service module is compiled, the generated VMService.java file appears in the /gen folder. I have exported this in the source code of the application as import com.VMService; But I am still getting run time errors during the launch of the application. The LogCat logs show this: Could not find class com.VMService 06-30 17:33:11.248: ERROR/dalvikvm(460): Could not find class 'com.VVMService', referenced from method com.samsung.vvmapp.VMApplication.onActivityResult 06-30 17:33:11.457: ERROR/AndroidRuntime(460): java.lang.NoClassDefFoundError: com.VMService Please let me know what wrong I am doing. Thanks, Priyank On Jun 24, 10:25 am, Krishna Shetty krishna.shett...@gmail.com wrote: It became clear now. Thank you Mark. The problem was, I am having my AIDL interface in a different package. And I have included the same AIDL interface package in both Service and Client application. But the intent-filter of the Service had action string with package name of the Service. So we can follow below while adding intent-filter, so trhat trick IScript.class.getName() will work. service android:name=.serviceName android:exported=true android:enabled=true intent-filter action android:name=package name of aidl interface.Interface name / /intent-filter /service thanks, Krishna On Jun 23, 7:02 pm, Mark Murphy mmur...@commonsware.com wrote: On Wed, Jun 23, 2010 at 9:57 AM, Krishna Shetty krishna.shett...@gmail.com wrote: Thank you very much Mark, Joe. But below call i.e., binding with the Interface name is not working. I got the same error, not able to bind, service not found.. bindService(new Intent(IScript.class.getName()), svcConn, Context.BIND_AUTO_CREATE); That means you have no service with an intent-filter containing an action string that matches the value generated by IScript.class.getName(). If you are taking that code from one of my samples, the corresponding manifest from those samples is set up properly: http://github.com/commonsguy/cw-advandroid/tree/master/AdvServices/Re... But, below way of binding works. i.e., Binding with the exported Service. Intent i = new Intent(); i.setClassName(com.mt.TestRemoteService, com.mt.TestRemoteService.MyService); bindService(i, svcConn, Context.BIND_AUTO_CREATE); This is extremely fragile. If the other application refactors its code, your code will break. Why bind with Interface name is not working for me? ( Note: I have added an intent-filter on the service with a Interface action ) Whatever you think you did, it is not working. Rather than use my IScript.class.getName() trick, it is probably simpler for you to just use the literal string. Copy whatever string is in your action and paste it as a string literal in your Intent constructor. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6 Available!- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en