Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

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 September 20th, 2010, 12:42 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2010
Location: New Brunswick Canada
Posts: 2
 
Device(s): Motorola Milestone
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to allenkb
Default Adding google maps to my application

i have been learning to make Android apps and have been making good headway. I decided to try doing a mpping app. I found a tutorial that simply displayed a google map. that is all it done. The tutorial went smooth and I was able to make it work. So now i want to incorporate what i have learned into an app i have been building. This app has several screens(instances) that display depending on menu selection, etc.

So here is my Android manifest..


<?
xmlversion="1.0"encoding="utf-8"?>
<

manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="ken.allen.android.Tower"
android:versionCode="1"
android:versionName="1.0">
<applicationandroid:icon="@drawable/icon"android:label="@string/app_name">
<uses-libraryandroid:name="com.google.android.maps"android:required="true"/>
<activityandroid:name=".Tower"
android:label="@string/app_name">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>


<activityandroid:name=".Activity2">
<activityandroid:name=".CreateDataBase"></activity>
<activityandroid:name=".BuildList"></activity>
<activityandroid:name=".datascreen"></activity>
<activityandroid:name=".Mapit"></activity>
</activity>






<


activityandroid:name=".datarecords"></activity>

 
 
<


activityandroid:name="BuildList"></activity>

</


application>

<


uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION">
<

uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/>
<

uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/>
<

uses-permissionandroid:name="android.permission.ACCESS_LOCATION"/>
<

uses-permissionandroid:name="android.permission.INTERNET"/>
<

uses-permissionandroid:name="android.permission.ACCESS_GPS"/></uses-permission>

 
 
</manifest>


I select my new intent froma menu item as follows

case


3:
// String v_band = spin2.getSelectedItem().toString();
Intent myIntent1 =


new Intent(Tower.this, Mapit.class);
// myIntent1.putExtra("BAND", v_band);
Tower.


this.startActivity(myIntent1);
returntrue;

My new Intent or mapper.xml contains the following.

<?


xmlversion="1.0"encoding="utf-8"?>
<

RelativeLayout
xmlns:android


="http://schemas.android.com/apk/res/android"
androidrientation


="vertical"
android:layout_width


="fill_parent"
android:layout_height


="fill_parent"
>
<


com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0EVD3Q_WMbtaa_vIjrPoaiN7Egbs8amSorNF-qw"
/>

</
RelativeLayout>



and the java for the mapper.xml is as follows

package ken.allen.android.Tower;

import android.app.Activity;
import android.os.Bundle;
import com.google.android.maps.MapActivity;

public class Mapit extends MapActivity{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mapper);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}


For some reason this will Force close when this intent is selected in the menu. I duplicated the tutorial worked for me int he beginning. Right now i would be happy just to dispplay the google map when the menu itme is slected. I can work on the rest after.






allenkb is offline  
Reply With Quote
sponsored links
Reply
Tags
android, google maps app process opening


Go Back   Android Forums > Android Development > Application Development
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 05:51 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.