Re: [android-developers] Re: How to use cp (Copy) command in system function in native C code on Android
On Thursday, March 22, 2012 1:02:20 AM UTC-4, Saurabh Patel wrote: Hi all Its resolved some problem of read write permission of my mounted directory Launching a process is still a very bad way to solve a problem on Android, which should only be resorted to when there is no alternative (for example, trying to do something as superuser on a device modified to marginally support that). Dianne gave you a very good alternative. Use it, as it will be more portable across devices, allow you to more easily detect failures, will not require a busybox install, and will be more likely to continue working on future Android versions. -- 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: How to use cp (Copy) command in system function in native C code on Android
Dianne gave you a very good alternative. Use it, as it will be more portable across devices, allow you to more easily detect failures, will not require a busybox install, and will be more likely to continue working on future Android versions. Even more than more likely I would think it would be insane if *that* interface quit working :-P 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: How to use cp (Copy) command in system function in native C code on Android
Thanks for Your Reply See my question properly. i want to to do copy via native code , i already installed busy-box so i can able to use cp command on android shell. cp command is working directly on shell but its not working via system call. So i want to know about how can i achieve this goal via system call. Thanks On 21 March 2012 23:08, A B saurbh...@gmail.com wrote: I want to copy file from on directory to another in my native C program. I tried using system function but it's not working. I tried this code in native code of Android int result = system(cp /mnt/test /Download/); // It's not working This system function returns 256 (error code) integer value. So we can say system function is working in Android. I also installed BusyBox so I can use the cp command also. If I execute directly cp /mnt/test /Download/ command then it's working fine. So what is problem here in system function. Have I missed something? Thanks Sam Jona -- 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: How to use cp (Copy) command in system function in native C code on Android
On Wed, Mar 21, 2012 at 10:07 PM, A B saurbh...@gmail.com wrote: Thanks for Your Reply See my question properly. i want to to do copy via native code , i already installed busy-box so i can able to use cp command on android shell. cp command is working directly on shell but its not working via system call. See Diane's response properly: you can't do this via the system call. 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
Re: [android-developers] Re: How to use cp (Copy) command in system function in native C code on Android
What you are doing is not supported in the SDK, so this is not an appropriate place to ask about it, sorry. On Wed, Mar 21, 2012 at 7:07 PM, A B saurbh...@gmail.com wrote: Thanks for Your Reply See my question properly. i want to to do copy via native code , i already installed busy-box so i can able to use cp command on android shell. cp command is working directly on shell but its not working via system call. So i want to know about how can i achieve this goal via system call. Thanks On 21 March 2012 23:08, A B saurbh...@gmail.com wrote: I want to copy file from on directory to another in my native C program. I tried using system function but it's not working. I tried this code in native code of Android int result = system(cp /mnt/test /Download/); // It's not working This system function returns 256 (error code) integer value. So we can say system function is working in Android. I also installed BusyBox so I can use the cp command also. If I execute directly cp /mnt/test /Download/ command then it's working fine. So what is problem here in system function. Have I missed something? Thanks Sam Jona -- 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.comandroid-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=enhttp://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. 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 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: How to use cp (Copy) command in system function in native C code on Android
Heh, It appears I spelled Dianne wrong... sorry about that... kris On Wed, Mar 21, 2012 at 10:25 PM, Kristopher Micinski krismicin...@gmail.com wrote: On Wed, Mar 21, 2012 at 10:07 PM, A B saurbh...@gmail.com wrote: Thanks for Your Reply See my question properly. i want to to do copy via native code , i already installed busy-box so i can able to use cp command on android shell. cp command is working directly on shell but its not working via system call. See Diane's response properly: you can't do this via the system call. 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
Re: [android-developers] Re: How to use cp (Copy) command in system function in native C code on Android
Hi kris and dianne If sdk is not supported than why this cp command is working if i execute on android shell manually. And i know android sdk is not supported cp command and so i installed busybox in this so i able to use cp command manually on amdroid shell. Now i am using system function which define in stdlib.h file of C. If i am able to do all operations of c code like fopen fclose and other functions of c via native code. Here i implemented native c code to execute c code in android. So dats why i am telling may be its possible Thanks On Mar 22, 2012 8:07 AM, Kristopher Micinski krismicin...@gmail.com wrote: Heh, It appears I spelled Dianne wrong... sorry about that... kris On Wed, Mar 21, 2012 at 10:25 PM, Kristopher Micinski krismicin...@gmail.com wrote: On Wed, Mar 21, 2012 at 10:07 PM, A B saurbh...@gmail.com wrote: Thanks for Your Reply See my question properly. i want to to do copy via native code , i already installed busy-box so i can able to use cp command on android shell. cp command is working directly on shell but its not working via system call. See Diane's response properly: you can't do this via the system call. 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 -- 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: How to use cp (Copy) command in system function in native C code on Android
On Thu, Mar 22, 2012 at 12:14 AM, A B saurbh...@gmail.com wrote: Hi kris and dianne If sdk is not supported than why this cp command is working if i execute on android shell manually. What you're doing is in the NDK. The NDK is not the same thing as running a shell on linux. It's different. Just because you can write a Linux program which does this, doesn't mean it will work that way from an Android NDK app. Here i implemented native c code to execute c code in android. So dats why i am telling may be its possible You see that @android.com thing behind Dianne's name. It means she works for Google... You can't do it like this.. 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
Re: [android-developers] Re: How to use cp (Copy) command in system function in native C code on Android
Hi all Its resolved some problem of read write permission of my mounted directory Thanks On Mar 22, 2012 9:49 AM, Kristopher Micinski krismicin...@gmail.com wrote: On Thu, Mar 22, 2012 at 12:14 AM, A B saurbh...@gmail.com wrote: Hi kris and dianne If sdk is not supported than why this cp command is working if i execute on android shell manually. What you're doing is in the NDK. The NDK is not the same thing as running a shell on linux. It's different. Just because you can write a Linux program which does this, doesn't mean it will work that way from an Android NDK app. Here i implemented native c code to execute c code in android. So dats why i am telling may be its possible You see that @android.com thing behind Dianne's name. It means she works for Google... You can't do it like this.. 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 -- 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