Skip to content

Commit

Permalink
Drone Fleet Map Implementation
Browse files Browse the repository at this point in the history
The app now has a start activity where setting can be launched or a
flight path may be created.

The setting screen displays the IP addresses for two physical drones for
live demonstration as well as specify the IP address for the simulator
and the number of drones to simulate in flight.

The map screen allows the user to create either a line or shape flight
path that the drone(s) will follow as a mission. From here an arraylist
is created that stores the latitude-longitude coordinates of the points
along the shape that will be passed on to the rest of the program. Upon
completion the Go command launches a screen where the user will select
either simulation or live drones for execution. At this point the user
is returned to the map screen to watch the results as they occur.
  • Loading branch information
Russell Folk committed Nov 10, 2014
1 parent 3bae671 commit b59aca0
Show file tree
Hide file tree
Showing 14 changed files with 550 additions and 52 deletions.
6 changes: 4 additions & 2 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="android-support-v4" level="project" />
<orderEntry type="library" exported="" name="google-play-services" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
<orderEntry type="library" exported="" name="play-services-6.1.71" level="project" />
</component>
</module>

4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:support-v4:21.0.0'
}
Binary file removed app/libs/android-support-v4.jar
Binary file not shown.
Binary file removed app/libs/google-play-services.jar
Binary file not shown.
26 changes: 25 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,38 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="guru.clevercoder.dronefleet.MainActivity"
android:name="guru.clevercoder.dronefleet.MainScreen"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="guru.clevercoder.dronefleet.SettingsScreen"
android:label="DroneFleet: Settings" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="guru.clevercoder.dronefleet.MainScreen" />
</activity>

<activity
android:name="guru.clevercoder.dronefleet.MapScreen"
android:label="DroneFleet: Flight Path" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="guru.clevercoder.dronefleet.MainScreen" />
</activity>

<activity
android:name="guru.clevercoder.dronefleet.GoScreen"
android:label="DroneFleet: Launch!" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="guru.clevercoder.dronefleet.MapScreen" />
</activity>


<meta-data
android:name="com.google.android.gms.version"
Expand Down
46 changes: 46 additions & 0 deletions app/src/main/java/guru/clevercoder/dronefleet/GoScreen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package guru.clevercoder.dronefleet;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
* Created by russell on 11/9/14.
*/
public class GoScreen extends Activity implements View.OnClickListener
{
private Button startLive;
private Button startSim;

@Override
public void onCreate ( Bundle savedInstanceState )
{
super.onCreate( savedInstanceState );
setContentView( R.layout.go_screen );
startLive = ( Button ) findViewById( R.id.btn_real );
startLive.setOnClickListener( this );
startSim = ( Button ) findViewById( R.id.btn_simulator );
startSim.setOnClickListener( this );
}

@Override
public void onClick ( View view )
{
Intent intent;
switch ( view.getId() )
{
case R.id.btn_real:
intent = new Intent( this, MapScreen.class );
startActivity( intent );
finish();
break;
case R.id.btn_simulator:
intent = new Intent( this, MapScreen.class );
startActivity( intent );
finish();
break;
}
}
}
46 changes: 46 additions & 0 deletions app/src/main/java/guru/clevercoder/dronefleet/MainScreen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package guru.clevercoder.dronefleet;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
* Created by russell on 11/9/14.
*/
public class MainScreen extends Activity implements View.OnClickListener
{
Button flightPath;
Button settings;

@Override
protected void onCreate ( Bundle savedInstanceState )
{
super.onCreate( savedInstanceState );
setContentView( R.layout.main_screen );
flightPath = ( Button ) findViewById( R.id.btn_flightPath );
flightPath.setOnClickListener( this );
settings = ( Button ) findViewById( R.id.btn_settings );
settings.setOnClickListener( this );
}

@Override
public void onClick ( View view )
{
Intent intent;
switch ( view.getId() )
{
case R.id.btn_flightPath:
intent = new Intent( this, MapScreen.class );
startActivity( intent );
finish();
break;
case R.id.btn_settings:
intent = new Intent( this, SettingsScreen.class );
startActivity( intent );
finish();
break;
}
}
}
Loading

0 comments on commit b59aca0

Please sign in to comment.