Android: How can i change the Build Target of one class - android

I have a project with Build Target Android 2.1 and i want to use Google map in it.
I know that to use the Google map i should create a project with Built Target Google APIs.
I want to extend MapActivity in one class not for all the project.
How can i do it?

I have one question: Google Map is a option in your app. or permanent feature?
In the first case I think you can encaplusate you code for Google Map in external jar.
In the second case I should change to GoogleApi(Android 2.1)

Related

RAD Studio TMapView Component can't working properly

I am learning to build Android Google Map app on RAD Studio 11. However, I got crush when the app is being launched. If I change the API key point to another package name, the app can be launched but the map is empty.
Do anyone know what is the matter? How could I fix the problem? Many thanks in advance.
Regards,
Kenny
After several investigations, the problem of the crash is caused by that the following line should be added back into the file "AndroidManifest.xml"
uses-library android:name="org.apache.http.legacy" android:required="false"
Remark: The < /> bracket are removed from the line above in order to correctly display the line content. Please add them back when you put the line back into the .XML file.
After Android 6, support for the Apache HTTP client has been removed and starting from Android 9, that library is removed from the bootclasspath and which is not available to android apps by default. As such, the aforesaid line should be added back to the "AndroidManifest.xml" file.
First, an API key is mandatory.
You need to create a project in Google Cloud Platform and enable Maps SDK for Android. When it's done you will get an API key.
On your Firemonkey application, you can add a TMapView.
In project options > Application > Version info. > add a new line, with key apiKey and value the api key you get from Google.
You need to also check the Maps checkbox in the Entitlements List in the Project Options.
That's all. You can do it in All configuration or only Android 32/64 bits.
Check what version you run, and set the apiKey correctly.
Otherwise, this page describe you what I told : https://docwiki.embarcadero.com/RADStudio/Sydney/en/Mobile_Tutorial:_Using_a_Map_Component_to_Work_with_Maps_(iOS_and_Android)
If the Map is empty, it's possible that you didn't use the correct API.

How do I render a map activity on android studio

I'm very, very new to Android and am currently trying to develop an app dealing with location. I want to start off on a map activity but after the first few times of rendering it correctly, it started giving me unrendered frangments and a rendering error. Pls Help.
Use the MapActivity provided by google in android studios.
Also make sure you have entered correct API key.
You can use this default activity on Android Studio.
Then, make sure you have an API key from google. Here's the link:
https://developers.google.com/maps/documentation/android-api/signup
After that:
Note: Always make sure that you are connected to the internet for the maps to render. Hope this helps!

How do I add a Google Maps fragment to an existing tabbed project?

I have successfully got Google maps working in Android Studio in an independent application. I also have a Sliding Tabs application working. Both are from scratch. But, How do I add a Maps fragment to an existing sliding tabs application? I have tried adding a "New > Google > Google Maps Activity" to the Java section along with the other code, which appears to load the libraries and code, but results in problems with the Build/Run configurations?? "Importing" modules don't appear to help, but I am probably doing something wrong. I am happy to set things up manually if I need to, but I don't know how to get all the libraries loaded to make Maps work in an existing application.
Cheers,
Chris
A little bit code would be helpful.
Create a MyMapFragment that extends MapFragment or SupportMapFragment.
Then modify your MainActivity to load that fragment when clicking on the map-tab.
Also make sure you added the PlayServices correctly and you inserted a working maps API key in your manifest.

snapshot of current location of map in android

I am trying to develop an app that can take a snapshot of current location from Google map and send an email (All this by click of a button)
I would like to do this in the background.
Is this possible?
I was trying out:
http://goo.gl/krFqXu
But the above code supports FragmentActivity, I am developing the app extending an activity.
Is it possible to use the same code in extending an activity? if so how? I am getting error in the following place:
myMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map_pass_home_call)).getMap();
If your question is only "How to not use Support lib", you can do this:
myMap = ((MapFragment)geFragmentManager().findFragmentById(R.id.map_pass_home_call)).getMap();
The support library helps you to support devices with an old version of the API. It seems you don't need that, so every sample code you found on the web that is using the "support" library always have a simpler equivalent in most recent version of the API.

how to use google map in android 2.3 application

While I am trying to extend my class to MapActivity it is show error like "no suggestion available". I had installed all the google apis.
You've to set the your project Target as per below image -
And, have a look at Google Mapview tutorial Don't forget to create an AVD as per same project creation with Google-API like below one

Categories

Resources