Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

DaveJ

(5,023 posts)
Mon Dec 12, 2011, 10:02 AM Dec 2011

General help creating an Android app (SD card in emulator)

I'm still on a steep learning curve trying to get a decent Android app created. I've already created a simplistic one with three buttons going to three separate screens, using Eclipse in Windows 7. But everything I'm doing is for the first time, and taking alot of time to figure out.

Right now, I'm struggling with one thing in particular: getting the Android emulator to mount an SD card I can write to. I have created a virtual SD Card, but I cannot figure out how to write a picture into the DCMI folder. When When I use DDMS to push a file, I get the message: "Failed to push selection: Read-only file system"

I see alot of other people asking the same question on the web but the answers are still confusing me. I could ask on Stackoverflow but they are so picky about duplicate questions....

Thanks, Dave

9 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
General help creating an Android app (SD card in emulator) (Original Post) DaveJ Dec 2011 OP
Ok, I figured this one out DaveJ Dec 2011 #1
You need to find the intent that encompasses all of those messaging options hootinholler Dec 2011 #2
Thanks!!!!!!!! DaveJ Dec 2011 #4
There's actually a pretty good sample app that does that. hootinholler Dec 2011 #7
I'll check out bookshelf DaveJ Dec 2011 #8
Well "read-only" sounds like the major clue. HopeHoops Dec 2011 #3
I'm using an emulator as opposed to an actual device. DaveJ Dec 2011 #5
If there's a way some pointy-haired boss can make life harder for you... HopeHoops Dec 2011 #9
Android is basically a custom linux kernal hootinholler Dec 2011 #6

DaveJ

(5,023 posts)
1. Ok, I figured this one out
Mon Dec 12, 2011, 01:00 PM
Dec 2011

At least I got it to work by launching the emulator from the command line (to say I have it 'figured out' might be an exaggeration.) It would be awesome to find someone who's done all this already.

Now, I need to add a sharing option for my own app. When I click the Share button for a picture it just tries to send it as a message, rather than showing a list of options that normally would appear... like Email, Facebook, Dropbox, Twitter, etc. I added something to my manifest but apparently didn't do it right. Or do I need a higher emulator. Right now I'm using 2.3...

hootinholler

(26,449 posts)
2. You need to find the intent that encompasses all of those messaging options
Tue Dec 13, 2011, 12:00 AM
Dec 2011

Then the OS will take over and put up the list of available choices on that device.

If your emulator doesn't have an email account then there won't be an email activity that can be included in the list.

DaveJ

(5,023 posts)
4. Thanks!!!!!!!!
Tue Dec 13, 2011, 03:09 PM
Dec 2011

I got that far yesterday actually. I didn't bother mentioning it, because I was afraid of creating a never-ending dialog with myself. I feel honored to be in the presence of someone who has apparently created an Android app at some point.

I have a few more challenging steps: 1) upload the picture (which I'm sure there are howto's out there), and then to 2) display the pictures taken in my app. I basically need to create a custom Gallery that displays the pics the way I need them. I'm not sure how to post information in order to get the correct information back, but I'll try on my own and see how far I can get. I'm accustomed to using web services.

I'm trying to make this app as simple as possible, but it's still daunting to me.

When I'm done doing all this, then I'm going to need to make an iPhone version too!

hootinholler

(26,449 posts)
7. There's actually a pretty good sample app that does that.
Tue Dec 13, 2011, 04:07 PM
Dec 2011

It's worth going through the tutorials and samples. IIRC, you want the bookshelf one. Basically you need to build a datasource backed by a directory. You can combine it with one backed by a DB to store the metadata from the images or other things.

Now I'm trying to figure out graphics and gestures. That's a pretty steep curve by itself for me, but I don't know a lot about graphics on any platform.

DaveJ

(5,023 posts)
8. I'll check out bookshelf
Tue Dec 13, 2011, 04:25 PM
Dec 2011

I probably will want the swipe gesture to look at pics, but I do not think I need any graphics as fancy as the existing gallery. Even gestures are not totally necessary, since I'm mainly interested in functionality over bells and whistles, at least for now.

This is my own project, not a work project, which I'm doing daily on my 90 minute train ride to and from work. If I have any more questions I'm sure you'll see another post from me in this group!

Thanks,
Dave

 

HopeHoops

(47,675 posts)
3. Well "read-only" sounds like the major clue.
Tue Dec 13, 2011, 11:01 AM
Dec 2011

I'm not familiar with Android, but if it has password protection it is probably mounting the SD card as it would any "other owner" device. Is there a way of checking ownership and granting access to "all" for whatever you want to do? Windows is a pain in the ass with file sharing and rights management, so I've been through similar problems. But memory sticks on Win/Mac/Linux usually just mount as an external drive with no problem and are compatible over all three platforms.

Next question - can you "pull" files from the SD card? If not, you've got much bigger problems.

Second question - is the error on trying to write to the VIRTUAL card or the real one? If there's no card inserted, how does it react?

DaveJ

(5,023 posts)
5. I'm using an emulator as opposed to an actual device.
Tue Dec 13, 2011, 03:20 PM
Dec 2011

There is no physical Android device in this scenario. Instead, there is an emulator that runs in Windows 7 that simulates what the Android phone would look like. This makes it easier than loading my application to the phone every time I want to test it. I write the code in Eclipse, which launches the Android emulator when I run the code.

I'm not dealing with any Windows 7 issues, it's Java being used to write within the Android system, all of which is new to me.

Anyway, I got the SD card in the emulator to work by rebuilding the "avd" file a different way (I think that's what I did anyway, not sure). Thanks!

hootinholler

(26,449 posts)
6. Android is basically a custom linux kernal
Tue Dec 13, 2011, 04:00 PM
Dec 2011

If you have a physical device, you cannot push or pull to the device, excepting to install an application. An application is a user for security purposes and the data area is private to each application.

You have to have root access to the device to manipulate data, which means for a phone you have to buy a special phone, or, install a rootkit. I've heard rumors that you might be able to get a carrier to give you root, but only rumors.

For the emulator, you already have root access, but the 'card' is mounted RO. You have to rsh to the device and remount the card RW.

Latest Discussions»Retired Forums»Website, DB, & Software Developers»General help creating an ...