using google maps in the java app - java

I want to use google maps in my java web app. What i want is when a user visits a particular page his location be showed in the map with its ip address as the input. Is it possible ?
Also the map should be able to locate the position the user entered in the text-field. How can i do that ?
I even downloaded http://code.google.com/p/gdata-java-client/downloads/list the jar files,samples from the link but they don't work as some of the packages are missing like com.google.gdata.util .

I have used Google maps more on the Javascript side.
And i always find Google Playground to be the best tutor in helping out.
Check it out.

You'll have to use JavaScript to use the Google Maps API. Here's a sample of using HTML5 geolocation to find someone's location: http://html5demos.com/geo
For user input, you might check out using the Google Maps API Places Library which has an autocomplete function: https://developers.google.com/maps/documentation/javascript/places#places_autocomplete

Related

Retrieve data from MySQL database by using Android QR Scanner

This is my first post in Stackoverflow. I'm a beginner in android and currently developing an app that uses a QR Scanner. The process is as below.
There're several objects with QR codes attached
App scans one QR code
Get the data retrieved related to that specific object (ex: name of the object, description of the object, images) from a remote MySQL database
Show the data in the app
So this is the simple process of the app. I do not know any technologies that I can use to achieve this since I'm a beginner. I would be obliged if someone could explain how I can do this.
Edit : This is different from directly calling data from MySQL database since it involves a QR code scanning part also. I can get the data from MySQL database and show it in android. But the complex part is how to get data automatically shown in the app after scanning the QR code. I have integrated Zxing QR Scanner.
Thank you.
According to your description, there are 2 main tasks you have to accomplish:
Scan QR code.
Retrieve info from a web service (which is backed by MySQL).
For (i), you would use popular QR Scanner libraries such as ZXing and ZBar. Using such libraries would require you to write some extra custom classes, just follow their instruction.
For (ii), you would use a networking library such as Retrofit, Volley, ... to get data from the web service.
Have you done any own research before asking here?
Nevertheless you can achieve your solution by trying out these steps:
1.) You need an API to scan your QR Code. By searching via Google i instantly found this page: http://code.tutsplus.com/tutorials/android-sdk-create-a-barcode-reader--mobile-17162 Here you can implement a barcode reader (but it also is able to read QC Codes as I understand)
2.) You need to find out which content the QR codes includes (e.g. an unique ID or something like that so you can identify your article)
3.) You need a database (e.g. you could use Apache Tomcat which includes a mySql database) where these IDs are stored.
4.) Your android app has to communicate with the server/database with e.g. webservices (you can google it, you will find some ways to implement webservices)
Still I can't you price "the" solution. You have to use google, read different tutorials and find out how you can solve your problem. If you are expecting difficulties you can still ask here.
I hope I still could help you a little.

How to get the file id querying the Google drive using Google drive Java Client Library

I ame making an System App for Google in android.which shares files from one Google account to another Google account.
As we know Android drive API have limited support for sharing operation.
For this purpose we are using Google APIs JAVA client.Now our problem is that we can not able to query the drive to get the folder id.
Also how can i query for files.Any one having any example like passing the query parameter "q".
Note:-I am using google-api-client-1.19.0.jar.
Anybody having some idea about this issue,please help us to resolve this issue.
It seems to me your question is "how can I query Drive?"
I was in a very similar situation. your link is very close to revealing how to do this... Yet it does not. I only found this out by looking at Google's JavaDocs and seeing the method signature.
Use the code from the link you shared, but add setQ("My query string for searching") to the .list() call. Example:
Files.List request = service.files().list().setQ("my query string for searching files in Drive");
FileList files = request.execute();
Documentation on what can go into the .setQ()
To Google:
There are clear issues with Google Drive's docs. The only close example in Google Drive's docs is for retrieving ALL the files in Drive. Gee, that's useful. Why is there NO example of passing a query to Drive??? Should we really need to sleuth the Java DOCs for such an obvious / primary feature? And it speaks to the level of the Drive team's community engagement that no one has answered this question.

Programmatically read comments on a Google Docs?

I have a client who wishes to create a program that compiles a list of comments from Google Docs. Is there a way to access Google Doc's comments through a scraper or perhaps an official API? I tried using JSOUP to get the information, but Google states that "javascript is unsupported on you browser" resulting in no text being generated. Any ideas for how to programmatically get a list of comments?
Use Drive API's comments resource to list the comments of a doc, samples and reference are available on https://developers.google.com/drive/v2/reference/comments/list

How to edit native google documents programmatically? [duplicate]

This question already has answers here:
How to programmatically manipulate native google doc files
(2 answers)
Closed 3 months ago.
I found few quite depressive QA here which mentioned that google documents cannot be modified programmatically in Google Drive API - there`s just upload/download option.
I checked those similar topics :
How to programmatically manipulate native google doc files
How do you create a document in Google Docs programmatically?
As I suppose we cannot download and upload directly native google doc formats. Is there any other way how to solve this requirement ?
Has anyone tried to trigger google app script programmatically on selected document, is that possible ? Is possible to start google app script programmatically with some parameters on the input ?
I just need to replace few pieces of text in native google doc`s but i cannot use download->modify->upload (e.g. with formats word/html/pdf) flow as i would broken formatting of pictures,borders etc... (customer requirement : full google integration no proprietary formats)
Do you have any innovative ideas or tips which would be good to explore ?
We are trying to use Google Drive as some kind of very simple templating system (~ thousands of users, hundreds of google documents) but it seems to be a really wrong idea as there is a lot of limitations on the way.
You can't use the Drive API to programmatically manage the content of a Google Document but you can use the Document Service in Apps Script to perform text replacing and other editing:
https://developers.google.com/apps-script/service_document
We invoke google app script deployed on the same domain as webapp which changes content of documents before we download them to proprietary format. We are just replacing few strings nothing complex.
This solution works but its a bit fragile (you have to install g app script + google app engine app in one domain), we are not sure how quickly are changes propagated after you trigger script so we wait always small amount of time e.g. 10 seconds before we try to download modified document.
Important disadvantage is that you cannot invoke GScript from localhost so development is a bit slower as we have to upload our app each time into google app engine.
Nowadays it's possible to use Java and other programming languages without having to use Google Apps Script by using the Google Docs API.
Also it is possible by using execute Google Apps Script code from other programming platforms by using Google Apps Script API, but it doesn't work with service accounts.
Notes:
There are some features available in the Google Docs user interface that aren't available in the Google Docs API.
Inserting content inside tables, that have rows and columns of different sizes might be complex due to the way that the indices work. Something that might help is to build the document from bottom to top.

How to programmatically retrieve google results?

Now that the Google search API has been discontinued - what is the best way to retrieve search results programmatically?
I need to get a list of files that have been indexed by google in my web site, so that I can write a script using that data.
What I want to do is delete everything cached under http://mysite.com/mypdfs/
i.e.
search for "site:mysite.com/mypdfs",
to get back a list of pdfs on mysite.com:
http://mysite.com/pdf/1.pdf
http://mysite.com/pdf/1.pdf
...
http://mysite.com/pdf/1000000.pdf
etc
Then use WebDriver to push them through the webmaster removal tool.
Happy to pay for the privilege if required...
You'll have to setup a Custom Search and use the new Custom Search API. It's similar to the old deprecated search API and does JSON or Atoms.

Categories