Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs-android-sample #18

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 27 comments
Open

docs-android-sample #18

GoogleCodeExporter opened this issue Mar 25, 2015 · 27 comments

Comments

@GoogleCodeExporter
Copy link

Which API (e.g. Google Calendar Data API)?
Google Document List and Google Spreadsheets
Version 3.0 preferably

What format (e.g. JSON, Atom)?
Atom

What Authentation (e.g. OAuth, OAuth 2, Android, ClientLogin)?
OAuth and AccountManager on Android

Java environment (e.g. Java 6, Android 2.2, App Engine 1.3.7)?
Android 1.5 onwards

External references, such as API reference guide?
http://code.google.com/apis/spreadsheets/data/3.0/
http://code.google.com/apis/documents/docs/3.0/

Please provide any additional information below.

Original issue reported on code.google.com by ptas...@gmail.com on 14 Sep 2010 at 1:30

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 21 Oct 2010 at 3:11

  • Added labels: Type-Sample
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I can provide the code (ready and running) for OAuth + List/Spreadsheets for 
Android, but it would need some cleanup and adaptation to form a proper code 
sample.

Original comment by ptas...@gmail.com on 21 Oct 2010 at 3:53

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 12 Nov 2010 at 1:41

  • Added labels: Priority-Low
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 12 Nov 2010 at 1:58

  • Changed state: Accepted
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html

Original comment by yan...@google.com on 21 Dec 2010 at 2:51

  • Changed title: docs-v3-atom-android-sample and spreadsheets-v3-atom-android-sample
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

got multiple requests to also include upload and download functionality

Original comment by yan...@google.com on 21 Dec 2010 at 2:54

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 23 has been merged into this issue.

Original comment by yan...@google.com on 21 Dec 2010 at 2:55

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 46 has been merged into this issue.

Original comment by yan...@google.com on 21 Dec 2010 at 2:55

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 58 has been merged into this issue.

Original comment by yan...@google.com on 21 Dec 2010 at 2:56

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

any idea when this is going to be available?
i was able to upload a file but they are always converted to document format 
(word) and i can't change privacy settings :|

Original comment by paulo...@gmail.com on 21 Dec 2010 at 6:35

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 22 Dec 2010 at 12:29

  • Added labels: Priority-Medium
  • Removed labels: Priority-Low

@GoogleCodeExporter
Copy link
Author

Issue 93 has been merged into this issue.

Original comment by yan...@google.com on 31 Dec 2010 at 7:30

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 31 Dec 2010 at 7:31

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Issue 94 has been merged into this issue.

Original comment by yan...@google.com on 3 Jan 2011 at 1:58

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Here is an example of how to upload a jpeg from android to google docs.

but i still have a lot of issues:
- The file ends up inside a word file, the flag convert=false does not work.
- I would like to post some metada with it and for some reason i can't make it 
work (tried with a MultipartRelatedContent ) 
- I'd like to change the acl to allow publishing of the document to people who 
have a link, also can't get this to work :|
- can't create folders also..


i hope the example helps somebody, and if anybody manage to found a solution to 
my issues, please let me know :)

public static String uploadFileToGoogleDocs(HttpTransport transport) {

        HttpRequest request = transport.buildPostRequest();

        request.url = new GoogleUrl(
                "https://docs.google.com/feeds/default/private/full/");

        GoogleHeaders headers = (GoogleHeaders) transport.defaultHeaders;
        headers.contentType = "image/jpeg";
        headers.gdataVersion = "3";
        headers.slug = "examplefile";

        AtomParser parser = new AtomParser();
        parser.namespaceDictionary = Namespace.DICTIONARY;
        transport.addParser(parser);
        File file = new File("/sdcard/DCIM/Camera/1293926357481.jpg");


         InputStreamContent bContent = new InputStreamContent();
         try {
         bContent.setFileInput(file);
         } catch (FileNotFoundException e) {

         e.printStackTrace();
         }

         bContent.type = "image/jpeg";
         request.content = bContent;

        com.google.api.client.http.HttpResponse res2;
        try {
            res2 = request.execute();
            return Utils.getStreamAsString(res2.getContent());
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }

Original comment by paulo...@gmail.com on 5 Jan 2011 at 7:15

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 92 has been merged into this issue.

Original comment by yan...@google.com on 8 Jan 2011 at 2:30

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 119 has been merged into this issue.

Original comment by yan...@google.com on 17 Feb 2011 at 1:21

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 121 has been merged into this issue.

Original comment by yan...@google.com on 17 Feb 2011 at 1:21

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 123 has been merged into this issue.

Original comment by yan...@google.com on 17 Feb 2011 at 1:22

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

waiting ........................

Original comment by zuzo...@gmail.com on 18 Feb 2011 at 5:23

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Thanks. Can you please provide a working docs sample for android (2.1 and 
above)?
Something I can import and run so I can learn from that?
Not familiar with the Authentication methods and with using the Google API
(Again, as said before, am familiar with android. developed few apps already)

Original comment by dan.shne...@gmail.com on 18 Feb 2011 at 6:06

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

If you wanted to add a title to the document, how would you do that ?

Original comment by jeremyvillalobos on 25 Mar 2011 at 3:06

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 26 Apr 2011 at 11:19

  • Added labels: Priority-Low
  • Removed labels: Priority-High

@GoogleCodeExporter
Copy link
Author

Original comment by yan...@google.com on 27 Aug 2011 at 4:26

  • Changed title: docs-android-sample
  • Added labels: Priority-Medium
  • Removed labels: Priority-Low

@GoogleCodeExporter
Copy link
Author

Issue 282 has been merged into this issue.

Original comment by yan...@google.com on 27 Aug 2011 at 4:27

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Issue 231 has been merged into this issue.

Original comment by yan...@google.com on 27 Aug 2011 at 4:42

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

@paulo, can you offer a little bit more detail on how you get that bit of code 
to work and upload a jpeg to google docs? I'm new to developing android apps 
and got several errors when trying to use your code, probably because I don't 
have the right libraries etc. 

Original comment by nabilaz...@gmail.com on 30 Dec 2011 at 10:23

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant