Go Back   Android Forums > Android Discussion > Android Applications > Tasker

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old May 5th, 2013, 02:52 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: May 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default google map v1

Hi,

I am trying to load google map v1 on android application but only able to see grid. no map. Guide please what thing i am missing?

Thanks

delickate is offline  
Reply With Quote
sponsored links
Old May 5th, 2013, 02:53 AM   #2 (permalink)
New Member
Thread Author (OP)
 
Join Date: May 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

my layout file is:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />

</RelativeLayout>
delickate is offline  
Last edited by delickate; May 5th, 2013 at 02:55 AM. Reason: more code require to explain
Reply With Quote
Old May 5th, 2013, 02:54 AM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: May 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Manifest file is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mymapactivity"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />

<permission
android:name="com.example.mymapactivity.permission .MAPS_RECEIVE"
androidrotectionLevel="signature" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<uses-permission android:name="com.example.mymapactivity.permission .MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_ST ORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.per mission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOC ATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCAT ION" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.mymapactivity.MyMapActiv ity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyALMHUu8GUhikgLs5au5tk5iBB0ail fc4k" />
</application>

</manifest>

Code files is:

package com.example.mymapactivity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptor Factory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class MyMapActivity extends Activity {
static final LatLng HAMBURG = new LatLng(53.558, 9.927);
static final LatLng KIEL = new LatLng(53.551, 9.993);
private GoogleMap map;
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_map);

map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
.title("Hamburg"));
Marker kiel = map.addMarker(new MarkerOptions()
.position(KIEL)
.title("Kiel")
.snippet("Kiel is cool")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.ic_launcher)));

// Move the camera instantly to hamburg with a zoom of 15.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(H AMBURG, 15));

// Zoom in, animating the camera.
map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.my_map, menu);
return true;
}

}


Please help
delickate is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Discussion > Android Applications > Tasker
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:57 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.