use of com.indooratlas.android.sdk.IALocation in project android-sdk-examples by IndoorAtlas.
the class MapsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
mIALocationManager = IALocationManager.create(this);
// optional setup of floor plan id
// if setLocation is not called, then location manager tries to find location automatically
final String floorPlanId = getString(R.string.indooratlas_floor_plan_id);
if (!TextUtils.isEmpty(floorPlanId)) {
final IALocation FLOOR_PLAN_ID = IALocation.from(IARegion.floorPlan(floorPlanId));
mIALocationManager.setLocation(FLOOR_PLAN_ID);
}
}
use of com.indooratlas.android.sdk.IALocation in project android-sdk-examples by IndoorAtlas.
the class ImageViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_view);
// prevent the screen going to sleep while app is on foreground
findViewById(android.R.id.content).setKeepScreenOn(true);
mImageView = (BlueDotView) findViewById(R.id.imageView);
mDownloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
mIALocationManager = IALocationManager.create(this);
mFloorPlanManager = IAResourceManager.create(this);
/* optional setup of floor plan id
if setLocation is not called, then location manager tries to find
location automatically */
final String floorPlanId = getString(R.string.indooratlas_floor_plan_id);
if (!TextUtils.isEmpty(floorPlanId)) {
final IALocation location = IALocation.from(IARegion.floorPlan(floorPlanId));
mIALocationManager.setLocation(location);
}
// Setup long click listener for sharing traceId
ExampleUtils.shareTraceId(findViewById(R.id.imageView), ImageViewActivity.this, mIALocationManager);
}
use of com.indooratlas.android.sdk.IALocation in project android-sdk-examples by IndoorAtlas.
the class MultiLocationMapView method updateLocationInternal.
private void updateLocationInternal(LocationEvent event) {
final String identity = event.source.id;
final IALocation location = event.location;
IALatLng latLng = new IALatLng(location.getLatitude(), location.getLongitude());
PointF point = mFloorPlan.coordinateToPoint(latLng);
float accuracy = location.getAccuracy() * mFloorPlan.getMetersToPixels();
Log.d(TAG, "converted location (" + event.location.getLatitude() + "," + event.location.getLongitude() + ") to point: " + point + " with floorplan: " + mFloorPlan.getId() + ", name: " + mFloorPlan.getName());
mKnownLocations.put(identity, new LocationEntry(event.source, point, accuracy));
}
use of com.indooratlas.android.sdk.IALocation in project android-sdk-examples by IndoorAtlas.
the class LocationStoreService method onHandleIntent.
@Override
protected void onHandleIntent(Intent intent) {
IALocation location = IALocation.from(intent);
if (location != null) {
LocationStore.obtain(this).store(location);
sendLocalBroadcast(location);
}
}
Aggregations