How to use google drive api in my android application? - android

I want to upload my application data to google drive.So I have to integrate Google Drive into my application, but I can't find any proper solution or source code for do that thing. So please if any one have full code of how to use Google Drive into android application than please help me.

First, a bit of critique. If you ask a question this way ('show me the magic trick'), it will get promptly down-voted, purged. It only shows you did not do your homework.
The other possibility is that you are starting and being totally lost (been there). If this is the case, let me give you a direction:
Study the 2 APIs available to Android, the REST Api and the GDAA. They do essentially the same thing, the selection very much depends on your app's needs.
Make decision which one to use. Pay special attention to the fact the GDAA supports only FILE scope, limiting the files/folder your app can see. Weight advantages/ disadvantages.
Study / play with the demo code for the API you selected. The links are in the docs you already studied (point 1 above). In case the official Google did not meet your needs, you may also look at the basic CRUD implementations of the 2 APIs here(REST) and here(GDAA)
As you'll see, you are weeks away from getting anywhere. And don't count on anybody here to do the work for you.
Good Luck

Related

How do I defer a subscription in Android (Google Play Billing)?

I have implemented an in app subscription in Android, it all works fine, I even have a 30 day free trial to begin with.
I have a referral feature in the app, so when a certain value in the database reaches 10 (i.e. 10 referrals) - I want to give the user a free 30 day subscription.
I have had a look around and think deferring the subscription by the desired amount would the solution. However, I have no idea how to go about this. The api docs dont seem to be Android-specific, and I cant find a proper tutorial anywhere. Any help massively appreciated.
Already tried looking at the docs - https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/defer
Do I just make the http request listed there? I was hoping for a nice in-built call I can make.
I simply wish for:
when a certain variable == 10, to defer, or increase the subscription length by 30 days.
Cheers mate.
Currently this is the only official way to do it. You may try to find some third party library on github, but I would not count on it.
I would recommend you to use Retrofit and create this call by yourself.
Maybe in (the) future Google will include this method as a default one in its billing library though - we just have to wait)
Hope it helps, mate.

Developing an Android app with monthly subscription

I want to develop an app which I stream basic text information about sports. First of all I believe I need a server which my users connect to see my stream as soon as something new is published. But I don't have an idea about how to build something like that. I did some search on web to find lessons or answers but I wasn't able to find anything useful. If it's true that I need a server, is Java language good to code server's program? Because I only know a little bit of Java.
And I want my app to have a monthly fee. I'm completely new to programming but I guess I need a database to keep track of my user information. Do I have to build my own user membership system - which people register with their e-mails etc- for all this? Is it hard to do that? And again I don't have any source of information about this one too.
I'm lost at this point. I don't know what to search to get some answers. So I'm asking you guys. What do I need to build an app with monthly fee that streams live information? I'm not expecting a full answer here but at least I believe you guys can tell me where to look for answers. Thanks.
While I agree the question is very vague and open (we could write a thesis on the topic in question and everyone will have their own way to complete) my suggestion would be to research the following:
Java - read as much as you can about the language and ensure that you are happy with (or know where you can get access to good helpers) the syntax (you mention that you know a little about Java so that is a good start).
Android programming in general. Look up the Activity lifecycle (The Android documentation is good, read as much as you can, follow the examples and try out the tutorials! https://developer.android.com/training/basics/activity-lifecycle/index.html)
Read up on Firebase; this should make the server side a little simpler (although I have only a parsing knowledge (i.e., none) of Firebase, it looks like it will be a good start). Again walk through the examples / tutorials; do the Hello World and then pull it apart to see if you can figure out how it is holding together.
Then when you have questions (which you will, we all do!) come back and I know that you will get some great help!
Once you have a few applications under your belt (personal 'play' apps) then and only then would I consider looking at the Google Play API (https://developers.google.com/android-publisher/).
Hope this gets you on the starting grid at least! Good luck!
Gav

How to do a Google Image Search in an android app

I'm developing an Android app that will do a Google Image Search and return the images to the user in a list. I've looked around on StackOverflow and have run into some problems. First off, I'm a total newbie programmer with only 4 months' worth of programming experience, so I appreciate you guys being patient with me.
I looked through Google Image Search API and I know it's being depreciated and will get shut down someday. Because of this, I don't want to use it. After extensive research on the topic, I don't want to use Bing or another image search service, and I don't want to do a "reverse image search. I just want to use a simple image search via string. I've used this app (https://github.com/tonytamsf/Android-Image-Search) to look at the code, but in all honesty, it's just not helping and it's confusing me more on how to exactly search for an image on Google. Plus, the app won't compile in Eclipse :(
I've also looked around at Google Developer APIs, and I'm not sure if I need to turn on an API key for myself? Still, a bit confused about that. I thought I needed to do a custom search engine, but just by looking at that, I don't think it's exactly what I'm looking for.
Can anyone point me to some resources for this? I would really appreciate it. Thank you!
Just a heads up, but what you're asking is pretty challenging and it sounds like you're just getting started. Here's what I can suggest though:
To get that demo code working in eclipse, I had to right-click the project, click properties, click Android, then check the box for the version of android installed. (I had android 19 installed, and the code was expecting 16, so it was giving up. Tell it to use what you have, which probably is 19). This worked for me after using the git plugin in eclipse to import the project. If you are importing a different way, you may have different issues. * Using git and importing the project is a good skill to have, so if that's unfamiliar territory, take the time to look at that.
Ok, that's the end of what I am sure of. The rest is an educated guess, but I'm sure others can correct me.
Next, if tinkering with that project isn't enough, getting real google image search working will take several skills, especially since the old API is gone. In total you'll need to know:
Java
Android programming
google cloud services
google custom search API
REST
some other libraries to glue the custom search to your app
It's a big chunk there. Currently, it seems the only way to use google's image search is to run a google app engine (you basically set up an online account for google to run a server for you. It does computation and sends messages back and forth for you. You only get a little bit for free each day and then if you want more you have to pay. This is one-way Google earns money. It's not something they let you run on your own computer anymore.). Then you make your android app talk to that server using your new login ID, and the server will take the search term and send back the answers to your android app.
You can get the app engine running and use it in chrome without dealing with android to save yourself time, then add the android part later in the future. Good luck!

Create custom google now cards

Google provides a variety of 'cards' for Google Now (http://www.google.com/landing/now/). Is it possible to create your own cards? The system looks pretty modular, but I haven't found any documentation or instructions to do so. (I believe you need to supply the content of the card, and some way of signaling when it is supposed to be shown. There is probably just some interface that you have to implement.)
If there is no documented solution, a hackish/undocumented way would be ok, too. I'm mostly curious how it works.
Edit: Specifically, does somebody have knowledge about the internals of Google Now, e.g. by decompiling the .apk? What I've seen suggests it is pretty modular, and it should be fairly easy to drop another class into the .apk, or to maybe inject code using Cydia Substrate. I know that there is (as of Nov. 2013) no official way to add new cards.
There is currently no way to do that. Google makes its own cards and custom application cannot register any cards. But I hope it will be possible in future.
Actually Google announced last week that developers can now develop custom Google Now cards:
http://www.google.com/landing/now/integrations.html
However, a developer guide seems not available yet.
Edit:
On the end of the page they point out that:
We'll let you know when we are able to onboard more partners
There is a work-around that will soon allow you to place cards in Google Now's stream at a particular time or a particular location: Use Google Keep (https://drive.google.com/keep/)
You can create a new card at Google Keep with a time based or location based reminder, depending on which the relevant card will show up in Google Now.
Since Google Keep is now in Drive, the API is expected to be available soon (keep a lookout for it at http://discovery-check.appspot.com/ )
There is not way to do this by your own at the moment. If you really want to do it you can fill in this form: https://services.google.com/fb/forms/nowintegrations/. You can ask Google if they want to cooperate to create a Google Now card.
Note quite an answer, as it is still not possible to create Google Now cards, but you can now hook into the Google Now search function (basically Android's Siri) and provide custom search results. For example you can say "show me the lyrics to..." and it opens a lyrics app.
Here is a link to the project which is based on the Xposed framework.
Just guessing from my impression of the Google Search apk (which includes all the Google Now functionality and even the home screen on KitKat), it should be possible to use a similar technique to inject cards into the app - however since the app is huge and very complicated, it will be a lot of work. I'd keep my eyes open on the xda-developers forums, wouldn't be surprized if someone there solves this in the future.
It appears that there is developer documentation on how to push google now info via email, eg. flight details, restaurant reservations etc.
https://developers.google.com/schemas/now/cards
I have yet to dig into this, but may update this answer if I discover anything significant.

Is there a good website to share and optimize code together?

Recently I am working on Android app development, and also I did iOS app before. I am not good at Android so far, so sometimes I found the app is kind lagging, thought stackoverflow.com is very nice place to share and found the bug, but I would like to ask if there are some websites that I can share all codes and details about the app, and there are also some programmers there they can read and point it out what's wrong with my app? I don't know if this question is legal here, just think it's good to have one and learn more..
You can post code and get it reviewed at https://codereview.stackexchange.com/
The best solution would probably be to push your projects to a site like Github where there's a great infrastructure in place to allow people to collaborate with you.
Asking people to do so is a different issue, but probably best achieved through posts on XDA-developers and equivalent forums.
There are plenty of places where you can post your entire source code. Here are two that I have used:
Google Code: allows you to post your code publicly with details about downloading. You can use this and google forumns to get reviewed and help. SVN access is easy to configure. Can add others to projects.
SourceForge: allows you to post code publicly and privately. SVN is easy once again. Allows you to add others users to the project with read/write/edit permissions.
Those two may not be the best places for getting reviewed and help easily, but they are wonderful for hosting and source control!
Also, these do have forumns where you can point others to your projects and ask questions!

Categories

Resources