Great module!

How would I go about implementing an image/filefield within the android application? I have the built in title and body working fine but I would like to add custom text fields, select boxes, and images. Of course i can easily add these fields within Drupal but I am unsure about adding them to the phone gap project.

It would be nice to see a short tutorial or list of steps in loading the files found at http://code.google.com/p/drupal-phonegap/downloads/list into a phonegap project. Do i need to deal with the other plugins found in your repository?

Comments

ngreenup’s picture

I have been able to successfully recompile your phonegap code in order to make my own android apk. I am still wondering about adding additional fields, tags, images to the form in the android app and have them saved on the drupal site.

ngreenup’s picture

I have added an additional text field to the content type and the android application and have it working great.

Still can't figure out how to handle an image upload. Currently I am able to get the android app to open the camera, take the photo, save it locally, and display it in the app. I am having trouble getting the image to transfer between the app and the drupal module/content-type.

Any working examples of a file/image field?

CarbonPig’s picture

Same question here. Any ideas or success stories?

Thanks!

CP

sgp913’s picture

I'd like to share my experience with this and maybe bump it along a little bit.

For my case, it involves user profiles, so I had to alter the bottom of the system_resources.inc file in services to push out $user_fields instead of $user, that way all the field api fields would show up. This works great as they now show up in the json and I can call them as I like. Problem is getting updates to that field.

For example, I have a field called 'field_name' which is displayed by calling 'field_name.und[0].safe_value'. I copy pasted the other edit profile code for username and have tried every single variation of 'field_name', 'field_name.und', etc. to no avail. I really have no idea which value would change it. Nothing gets changed in the DB and the app erases out the data and is 'undefined' which crashes it.

I think the main issue here is not the files and images support, as of this moment. It is updating these field api fields. I would also like to upload images, but I think we should try to tackle simple text fields first to make sure they work properly and make everyone aware of a standardized way to do it, then move on to the more complex fields.

ngreenup, could you share what you did to accomplish adding the custom field to the node?

sgp913’s picture

Update: field_whatever[und][0][value] works, however, getting it to that point requires a lot of busy work in Drupalgap because of the verification process, assigning variables, etc. I just copy pasted the 'name' field in every location and changed it to this field.

Now, to move onto the image and audio fields...however the iOS emulator doesn't have a camera. It should just use the iSight camera but that's a different issue.

Another thing I would like to bring up is the reason why it PUT instead of POST. I don't know too much about this but it seems that PUT is only for updating variables instead of creating them? Is there a difference within Drupal or do they function the same because field API handles it?

rickharington’s picture

Very interested in seeing file and image support. Trying to build a music app similar to iTunes and would love for visitors to download and upload music files from the App.

Alex Andrascu’s picture

Assigned: Unassigned » Alex Andrascu
Category: support » feature

This looks like a nice feature. Let's have a look into it.