Google Maps fragment activity - java

I am really sorry to ask such a bland and stupid question, but I am having the greatest of frustrations with trying to load the Google Maps project library into my project resources.
I have downloaded all the tools and necessities needed from the SDK to get Google Maps.
However, whenever I try to load the Google Maps library, I get 2 errors.
The first is that for some reason,
the Class known as FragmentActivity is missing. I have no idea what
it is or where to find it to get things going with an Android project.
The second distinct problem is that the console shoots off the following message:
"google_maps] Unable to resolve target 'android-16'"
Although I have a fairly strong idea of what this means, I don't quite know how to troubleshoot so that the library is built towards the desired API level.
I do apologize as I am new to Android and absolutely love the platform, but this one really has me dumbfounded. Any and all information and suggestions is always most appreciated.
Thanks and once again, sorry for asking something so silly.

Well for the first question:
FragmentActivity is part of the google-support-v4 library and designed for application that are developed to SDK < 11 for supporting fragments. So you didn't added the referencing of this library to you project.
you can get a better idea of the imports you need to make and how to make them by reading this
blog post I wrote on Google Map API V2:
Google Map API V2 guide
about your second question, you probably trying to run this project against an API level you didn't downloaded from the SDK Manager, you have two options:
downloaded the needed API package from the SDK Manager.
right click on your project -> Properties -> Android -> change the project build target to a target that you have its API level downloaded.

Try this answer, Generate Google Map key for android - step by step.
Or take a look to this very helpful step by step tutorial. I struggle for 3 days with the maps stuff, but that tutorial showed me the light.

Related

Android : handle click on 3D object arcore, android studio - JAVA

I'm working on an AR Application for Android with Google ArCore SDK (using Android Studio and Java). I have a problem to handle invents : tap or clic on displayed image/3D Object, weither it is about Augmented images or placing a permanent anchor.
Please do you have any example of how to handle click on 3D object in Android Studio?
Thank you.
From this post:
ARCore is not supporting this feature. You need to do it by yourself.
The most recommended method is use of ray casting. Assuming you're using OpenGL, this post describes some methods of using ray casting in the way you need.
After looking through deep research, I found out that there is an open existing project for sceneform that is still working.
You can find the project here :
https://github.com/SceneView/sceneform-android
and some Android Java samples there :
https://github.com/SceneView/sceneform-android/tree/master/samples
But pay attention, it seems that some methods in samples are deprecated. I'm working on integrating this in my Augmented Image project but I have some trouble finding corresponding new methods for some of them.
I will appreciate any help from someone who has already done it.

APIException 9011 and 9010 error in Places SDK

I am new to Android Development and I am learning Maps SDK for Android.
My API key for Maps SDK is working fine and I am able to see Map on my screen with a marker.
But the problem is, I am not able to use the Place Autocomplete service and facing the following two errors:
APIException code 9011
APIException code 9010
Here my Places SDK is not working though I have enabled it while creating API Key. I have searched about these two errors but yet I am unable to find the reason for the above-mentioned errors. Sorry for using bad English, please tell me the reason why it's happening with me.
These are the errors you are getting:
https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesStatusCodes#public-static-final-int-over_query_limit
and
https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesStatusCodes#public-static-final-int-request_denied
Make sure you are using the newest Places SDK client and that you are have enabled the Places API.
https://developers.google.com/places/android-sdk/client-migration
You can check these above mentioned APIException codes at link. After that Ensure that your Places SDK is turned on. But places SDK will only work if you have attached your credit card to the Google Maps account. that's all.

android java add edit contacts google accounts

I want to access (add, edit) contacts of Google accounts on an android device. I'm using Android Studio.
I've found couple posts on http://stackoverflow.com:
Android - sync contact add programatically to google account
Xml model for adding contact to google contacts
However, first mentions problem and have no answer, second has only some parts of code and both do not show how to choose account if there are sereral on a device.
I foresee it could be considered broad question, however, if OK, please advice how to do my task with less code and setup (e.g. Maven or jar libraries or else) and with specific code samples - via Google API or some other way?
I think you'll be better off delegating this kind of work to the system, using Intents. You can have a look at how Google recommends to do it here
I hope this helps!

AppWidget provider cannot see layout

I decided to add a App Widget to my application , I follow this guide on official Android developer page (link). Done everything what they have there and still I get this error:
I have my app-widget provider in /res/xml. Having widget layout in /layout folder and having AppWidgetProvider.java in Java folder.
So everything should be fine. Also I am using latest Android Studio with latest SDK (23) and latest build tools (23.0.2) and also using appcompat-v7 suppport library.
I pasted code from the page, just to be sure everything is in order. Seems like it's not.
I am frustrated after several hours of trying everything. My appplication is long term project, I am almost at the code version 200, so I have some experience, but not with this. I also read almost the whole thing.
PS: Any code would be useless to post in here, since it's the same code from that official Android Developer page. I wanted to do "prototype", which I can then customize to my needs. I never worked with widgets.

android.net.SntpClient is missing from Android SDK

I am trying to get time from an Internet Time Server. And I found that android.net.SntpClient is a good solution that I could use.
But my Android SDK (Android API 19) does not contain that class. I downloaded the "Sources for Android SDK" via SDK Manager and the source code contains the SntpClient.java (source file for class android.net.SntpClient)
Please view the images links I uploaded. (sorry, I dont have enough reputation for images right here)
The android SDK:
https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/1888504_897281990284152_2310291065247680835_n.jpg?oh=989c5f49848a8914d77bb0d4aac8897d&oe=54F8E9D6
The sources:
https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/10659310_897281993617485_1823842706987095742_n.jpg?oh=27ee6a075967731dc7265352c22002cd&oe=54DCBB73
Could anyone tell me why this file is not compiled? If I want to use this class, I have to explain to my boss why android SDK doesn't contain it.
Thanks a lot
Google has chosen not to make all public classes available as part of the SDK. Visibility is controlled by the #hide comment tag as described here.
I'm not sure why they chose to hide SntpClient particularly, but provided you respect the terms of the Apache license you can copy the source into your application without much modification.

Categories