Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

done !

  • Loading branch information...
commit 7bd7c0a18aae0fa9deabd6382ed02f869bd75aa5 1 parent f161b37
@MimozaLl authored
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/PinPoint.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/R$drawable.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/R$id.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/R$layout.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/R$menu.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/R$string.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/R$style.class
Binary file not shown
View
BIN  FoursquareAssig/bin/classes/com/example/foursquareassig/ShowMap.class
Binary file not shown
View
9 FoursquareAssig/gen/com/example/foursquareassig/R.java
@@ -15,10 +15,11 @@
public static final class attr {
}
public static final class drawable {
- public static final int ic_action_search=0x7f020000;
- public static final int ic_launcher=0x7f020001;
- public static final int instructions=0x7f020002;
- public static final int marker=0x7f020003;
+ public static final int home=0x7f020000;
+ public static final int ic_action_search=0x7f020001;
+ public static final int ic_launcher=0x7f020002;
+ public static final int instructions=0x7f020003;
+ public static final int marker=0x7f020004;
}
public static final class id {
public static final int Spinner2=0x7f080005;
View
BIN  FoursquareAssig/res/drawable-hdpi/home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 FoursquareAssig/res/values-de/strings.xml
@@ -1,9 +1,9 @@
<resources>
- <string name="app_name">4Map</string>
+ <string name="app_name">4map</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Einstellungen</string>
- <string name="title_activity_main">App Name</string>
+ <string name="title_activity_main">4map</string>
<string-array name="search">
<item>Essen</item>
View
2  FoursquareAssig/res/values/strings.xml
@@ -3,7 +3,7 @@
<string name="app_name">4Map</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
- <string name="title_activity_main">App Name</string>
+ <string name="title_activity_main">4Map</string>
<string-array name="search">
<item>Food</item>
View
9 FoursquareAssig/src/com/example/foursquareassig/PinPoint.java
@@ -8,14 +8,16 @@
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;
-public class PinPoint extends ItemizedOverlay <OverlayItem> {
+public class PinPoint extends ItemizedOverlay<OverlayItem> {
- private ArrayList<OverlayItem> pinpoints =new ArrayList<OverlayItem>();
+ private ArrayList<OverlayItem> pinpoints = new ArrayList<OverlayItem>();
private Context c;
+
public PinPoint(Drawable defaultMarker) {
super(boundCenter(defaultMarker));
// TODO Auto-generated constructor stub
}
+
public PinPoint(Drawable m, Context context) {
this(m);
c = context;
@@ -33,8 +35,7 @@ public int size() {
return pinpoints.size();
}
- public void insertPinpoint(OverlayItem item)
- {
+ public void insertPinpoint(OverlayItem item) {
pinpoints.add(item);
this.populate();
}
View
176 FoursquareAssig/src/com/example/foursquareassig/ShowMap.java
@@ -21,14 +21,14 @@
import com.google.android.maps.OverlayItem;
public class ShowMap extends MapActivity implements LocationListener {
-
+
MapView map;
long start;
long stop;
public JSONRequest jr2;
MyLocationOverlay compass;
MapController controller;
- int x, y;
+ int x,y;
GeoPoint touchedPoint;
GeoPoint myPoint;
Drawable d;
@@ -36,75 +36,74 @@
LocationManager lm;
String towers;
public int lat;
- public int lng;
- public int alat;
- public int along;
- public double plat;
- public double plng;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_show_map);
-
- map = (MapView) findViewById(R.id.mvMain);
- map.setBuiltInZoomControls(true);
-
- Intent i = getIntent();
- String p = i.getStringExtra("position");
- String urlString = i.getStringExtra("url");
- int in = Integer.parseInt(p);
-
- jr2 = new JSONRequest();
- jr2.getJSONfromURL(urlString);
- plat = jr2.latitude[in];
- plng = jr2.longitude[in];
-
- alat = (int) (plat * 1E6);
- along = (int) (plng * 1E6);
-
- // Current Location
- lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- Criteria c = new Criteria();
- towers = lm.getBestProvider(c, false);
- Location location = lm.getLastKnownLocation(towers);
-
- lat = (int) (location.getLatitude() * 1E6);
- lng = (int) (location.getLongitude() * 1E6);
- // lat = 68040333;
- // lng = 10234556;
- overlayList = map.getOverlays();
- compass = new MyLocationOverlay(ShowMap.this, map);
- overlayList.add(compass);
- controller = map.getController();
- GeoPoint point = new GeoPoint(lat, lng);
-
- controller.animateTo(point);
-
- controller.setZoom(15);
- d = getResources().getDrawable(R.drawable.marker);
-
- GeoPoint ourLocation = new GeoPoint(lat, lng);
- OverlayItem overlayItem = new OverlayItem(ourLocation, "Hello",
- "Hello2");
- PinPoint custom = new PinPoint(d, ShowMap.this);
- custom.insertPinpoint(overlayItem);
- overlayList.add(custom);
-
- // takes the coordinates of the selected place and displays a pinpoint
- // on the map
- GeoPoint randomLocation = new GeoPoint(alat, along);
- OverlayItem overlayItem1 = new OverlayItem(randomLocation, "Yes",
- "yesss");
- PinPoint mypoint = new PinPoint(d, ShowMap.this);
- mypoint.insertPinpoint(overlayItem1);
- overlayList.add(mypoint);
- }
-
- @Override
+ public int lng;
+ public int alat;
+ public int along;
+ public double plat;
+ public double plng;
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_show_map);
+
+ map=(MapView)findViewById(R.id.mvMain);
+ map.setBuiltInZoomControls(true);
+
+ Intent i = getIntent();
+ String p = i.getStringExtra("position");
+ String urlString = i.getStringExtra("url");
+ int in = Integer.parseInt(p);
+
+ jr2 = new JSONRequest();
+ jr2.getJSONfromURL(urlString);
+ plat = jr2.latitude[in];
+ plng = jr2.longitude[in];
+
+ alat = (int) (plat*1E6);
+ along = (int) (plng*1E6);
+
+ //Current Location
+ lm=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
+ Criteria c =new Criteria();
+ towers =lm.getBestProvider(c, false);
+ Location location=lm.getLastKnownLocation(towers);
+
+
+ lat = (int) (location.getLatitude()*1E6);
+ lng = (int) (location.getLongitude()*1E6);
+ //lat = 68040333;
+ //lng = 10234556;
+ overlayList =map.getOverlays();
+ compass= new MyLocationOverlay(ShowMap.this,map);
+ overlayList.add(compass);
+ controller = map.getController();
+ GeoPoint point = new GeoPoint(lat, lng);
+
+ controller.animateTo(point);
+
+ controller.setZoom(15);
+ d = getResources().getDrawable(R.drawable.marker);
+
+ GeoPoint ourLocation=new GeoPoint(lat,lng);
+ OverlayItem overlayItem =new OverlayItem(ourLocation, "Hello","Hello2");
+ PinPoint custom =new PinPoint(d, ShowMap.this);
+ custom.insertPinpoint(overlayItem);
+ overlayList.add(custom);
+
+ //takes the coordinates of the selected place and displays a pinpoint on the map
+ GeoPoint randomLocation=new GeoPoint(alat, along);
+ OverlayItem overlayItem1 =new OverlayItem(randomLocation,"Yes","yesss");
+ PinPoint mypoint=new PinPoint(d, ShowMap.this);
+ mypoint.insertPinpoint(overlayItem1);
+ overlayList.add(mypoint);
+ }
+
+
+
+ @Override
protected void onPause() {
// TODO Auto-generated method stub
- compass.disableCompass();
+ compass.disableCompass();
super.onPause();
lm.removeUpdates(this);
}
@@ -114,45 +113,48 @@ protected void onResume() {
// TODO Auto-generated method stub
compass.enableCompass();
super.onResume();
- lm.requestLocationUpdates(towers, 500, 1, this);
+ lm.requestLocationUpdates(towers,500,1,this);
}
@Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.activity_main, menu);
- return true;
- }
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return true;
}
-
+
public void onLocationChanged(Location l) {
// TODO Auto-generated method stub
- lat = (int) (l.getLatitude() * 1E6);
- lng = (int) (l.getLongitude() * 1E6);
- GeoPoint ourLocation = new GeoPoint(lat, lng);
- OverlayItem overlayItem = new OverlayItem(ourLocation, "Hello",
- "Hello2");
- PinPoint custom1 = new PinPoint(d, ShowMap.this);
- custom1.insertPinpoint(overlayItem);
- overlayList.add(custom1);
- controller.animateTo(ourLocation);
+ lat=(int) (l.getLatitude()*1E6);
+ lng=(int) (l.getLongitude()*1E6);
+ GeoPoint ourLocation=new GeoPoint(lat,lng);
+ OverlayItem overlayItem =new OverlayItem(ourLocation, "Hello","Hello2");
+ PinPoint custom1 =new PinPoint(d, ShowMap.this);
+ custom1.insertPinpoint(overlayItem);
+ overlayList.add(custom1);
+ controller.animateTo(ourLocation);
}
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
-
+
}
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
-
+
}
public void onStatusChanged(String provider, int status, Bundle extras) {
- // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
}
}
+
+
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.