implementing location based services - android

i am trying to implement this tutorial but i am getting errors in these line
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.Overlay;
in WhereAreMyFriendsMap.java
Is there anything else like jar i need to add
Thanks

You have to set your Project Build Target to the Google APIs version of the API level you're targeting. You most likely have it set to Android API.

From the same tutorial, do you have everything they mentioned here?
Getting started is pretty well-worn ground. Pull down the latest Android SDK and JDK (5 or newer). Download and install Eclipse for Java developers (3.2 or newer) and the ADT Eclipse plugin and you're set. There's more detail at StackOverflow, on the Android code site, and the Android support forums.

Related

Cannot import android.hardware.camera2

I am trying to import android.hardware.camera2.*; to my project but android studio cant find it. It only shows android.hardware.Camera and android.graphics.Camera. My compile sdk version is also 23 so I don't know how to fix this.
That is because there is no Java class in Android named android.hardware.Camera2. There is a Java package named android.hardware.camera2. You are welcome to use classes out of that Java package, such as android.hardware.camera2.CameraManager, via import statements like:
import android.hardware.camera2.CameraManager;

eclipse can't find android.support.v4.widget.SwipeRefreshLayout

Even after clicking on Add Support Library and choosing version 19, eclipse still can't find android.support.v4.widget.SwipeRefreshLayout. Does anyone know how to get this to work? I am using
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
I am working on a mac mavericks computer with Juno.
update: import section
import java.util.Observer;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;
import android.support.v4.widget.SwipeRefreshLayout;//red underline
Update
By the way, I don't know if this matters: this is an Appengine Connected Android Project, which I build using Google-Eclipse-Plugin
Update 3:
It's looking like the Android Support Library 19.1.0 is not available through the SDK Manager. How else might I obtain it?
It was difficult to update the support library to version 19.1 so i downloaded it manually from https://dl-ssl.google.com/android/repository/support_r19.1.zip and added the jar to my build path manually. works for me. I dont know why the 19 update shows instead of 19.1.0
So it turns out the library is in the following location
/android-sdk-macosx/extras/android/m2repository/com/android/support/support-v4/19.1.0
As opposed to the usual
/android-sdk-macosx/extras/android/support
Also I had to restart eclipse and go to Android SDK Manager over and over and over, until the 19.1.0 version shows up.
I hope this saves someone else some trouble.
The SDK Manager update Android Support Library to 19.1.0.
But when you use Android Tools > Add Support Library, eclipse update Android Support Library to 19.0. I think this is a bug. Copy Android Support Library 19.1.0 to libs folder manually.
It looks as if you don't have the android-support-v4.jar in Java Build Path. Add it from the android-support-v7-appcompat.
For some reason, even though you may include v4 support library or you may have v7-appcompat included in your project, you may not be able to import SwipeRefreshLayout.
You need to make sure that
you change the target=android-19 to target=android-22(It should be anything greater that 19) and
manually import : import android.support.v4.widget.SwipeRefreshLayout; in your activity which will resolve the import related issue.
I had the same problem with old project. But when I create new project, Eclipse can find this import.
It's a problem with updating support library from eclipse: https://code.google.com/p/android/issues/detail?id=67991
Just update it by starting Android SDK manager manually and add new v4 lib to your project.
Thanks for tehnolog's tips.
Update to 19.1 by follow above link -> create new project and import android.support.v4 library -> simply copy android.support.v4.jar to old project's libs folder, Add To BuildPath. SwipeRefreshLayout will appear :D
In androidx, add
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
inorder to use SwipeRefreshLayout

how to import android licensed project in eclipse?

Can anyone help me to know how to import licensed project, while trying... the following classes cannot be imported.
import com.android.vending.licensing.LicenseChecker;
import com.android.vending.licensing.LicenseCheckerCallback;
import com.android.vending.licensing.ServerManagedPolicy;
import com.android.vending.licensing.AESObfuscator;
Any help will really be appreciated. Thanks
The latest version of the LVL seems to require
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;
import com.google.android.vending.licensing.AESObfuscator;
instead of
import com.android.vending.licensing.LicenseChecker;
...
(as the current document tells me to do)
It took me a half day to figure this out.. haha
LVL library can be downloaded using the SDK Manager
Link
The License Verification Library (LVL) is a collection of helper classes that greatly simplify the work that you need to do to add licensing to your application. In all cases, we recommend that you download the LVL and use it as the basis for the licensing implementation in your application.
The LVL is available as a downloadable component of the Android SDK. The component includes:
The LVL sources, stored inside an Android library project.
An example application called "sample" that depends on the LVL library project. The example illustrates how an application uses the library helper classes to check and enforce licensing.
To download the LVL component into your development environment, use the Android SDK and AVD Manager. Launch the Android SDK and AVD Manager and then select the "Market Licensing" component, as shown in the figure below. Accept the terms and click Install Selected to begin the download.

Android launching a MapActivity?

I'm trying to set up the google maps API for an application. I'm following this link:
http://developer.android.com/guide/tutorials/views/hello-mapview.html
Yes, I got my own APK key in the xml and added all the manifest stuff they wanted. But my Java code is giving me an error:
import android.app.Activity;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;
import com.google.android.maps.MapActivity;
public class PathTracker extends MapActivity {
#Override
protected boolean isRouteDisplayed() {
return false;
}
}
Apparently MapActivity is an undefined class, and my last import doesn't help.
Can anyone help me access the MapActivity class?
Thanks.
You need to use the Google APIs SDK instead of the plain Android SDK. You can download this SDK (the one that matches the API level you want) from the android application in the sdk tools. Then edit your project in Eclipse and use that as the SDK.
Go to the android tool (from Eclipse, go to Window -> Android SDK and AVD Manager) or look for the executable in the android sdk directory.
Select Available packages, expand Third party add-ons, expand Google Inc, select the one you want, and download it.
Back in Eclipse, right click your project, select properties. Under the Android menu, select the SDK you downloaded in step 2 as the target.

error in imports of import com.google.android.maps.MapActivity;

Hello i want to run this tutorial but i getting error on importing
import com.google.android.maps.MapActivity;
import com.google.android.maps.GeoPoint;
Although i have updated available packages
Have you changed your build target to use the Google API form of your API level?
for error "import com.google.android.maps.GeoPoint;"
Please Include this jar (below given link)
http://www.java2s.com/Code/Jar/a/Downloadandroidgooglemapsapi11jar.htm

Categories

Resources