Implementasi Algoritma Dijkstra Dalam Penentuan Rute Terpendek Berbasis Mobile GIS (Studi Kasus: Universitas Sumatera Utara)

Teks penuh

(1)

LAMPIRAN A : LISTING PROGRAM

1. Listing Program Eclipse (Java dan XML)

MainActivity.java

package com.mobilegisdijkstra; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View;

import android.view.View.OnClickListener; import android.widget.Button;

public class MainActivity extends Activity { private Button btnMenu;

private Button btnCaraPenggunaan; private Button btnTentangAplikasi;

public void onCreate(Bundle savedInstanceState) { final Context context = this;

super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

btnMenu = (Button) findViewById(R.id.button1);

btnCaraPenggunaan = (Button) findViewById(R.id.button2); btnTentangAplikasi = (Button) findViewById(R.id.button3); btnMenu.setOnClickListener(new OnClickListener() { @Override

public void onClick(View arg0) {

Intent intent = new Intent(context, MenuPilihan.class); startActivity(intent); } });

btnCaraPenggunaan.setOnClickListener(new OnClickListener() { @Override

public void onClick(View arg0) {

Intent intent = new Intent(context, CaraPenggunaan.class); startActivity(intent); } });

btnTentangAplikasi.setOnClickListener(new OnClickListener()) { @Override

public void onClick(View arg0) {

Intent intent = new Intent(context, TentangAplikasi.class); startActivity(intent); } }); } }

Activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="horizontal|vertical" android:orientation="vertical" > <TextView android:id="@+id/textView2"

(2)

android:layout_gravity="center" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView5"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:fontFamily="Times New Roman" android:text="@string/usu" android:textSize="50sp"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/title"

android:textAppearance="?android:attr/textAppearanceLarge" android:textStyle="bold" />

<TextView android:id="@+id/textView3"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/subtitle"

android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView8"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <Button android:id="@+id/button1"

android:layout_width="803dp" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/enter"

android:typeface="serif" />

<Button android:id="@+id/button2"

android:layout_width="803dp" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/howtouse" android:typeface="serif" />

<Button android:id="@+id/button3"

android:layout_width="803dp" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/about"

android:typeface="serif" />

<TextView android:id="@+id/textView10"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView9"

(3)

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView6"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:fontFamily="Arial"

android:text="@string/judul1" android:textColor="#CCFF00" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView7"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:fontFamily="Lucida Handwriting" android:text="@string/judul2" android:textColor="#CCFF00"

android:textAppearance="?android:attr/textAppearanceMedium" /> </LinearLayout>

CaraPenggunaan.java

package com.mobilegisdijkstra; import android.os.Bundle; import android.app.Activity;

public class CaraPenggunaan extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

setContentView(R.layout.layout_howtouse); } }

layout_howtouse.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:scrollbarStyle="outsideInset" android:scrollbars="horizontal|vertical" >

<TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge"/> <TextView android:id="@+id/textView2"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/howtouse"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView5"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/artihowtouse"

(4)

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center"

android:text="@string/isihowtouse" android:textColor="#669966" android:textAppearance="?android:attr/textAppearanceLarge" android:textStyle="italic" android:typeface="serif" />

</LinearLayout>

TentangAplikasi.java

package com.mobilegisdijkstra; import android.os.Bundle; import android.app.Activity;

public class TentangAplikasi extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

setContentView(R.layout.layout_about); } }

layout_about.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="horizontal|vertical"

android:orientation="vertical" >

<TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView2"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/about"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView5"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/artiabout"

android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3"

(5)

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center"

android:text="@string/isiabout" android:textAlignment="center" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#669966" android:textStyle="italic" android:typeface="serif" />

</LinearLayout>

MenuPilihan.java

package com.mobilegisdijkstra; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View;

import android.view.View.OnClickListener; import android.widget.Button;

public class MenuPilihan extends MainActivity { private Button btnTampilPeta;

private Button btnCariRuteTerpendek; private Button btnCaraPenggunaan;

public void onCreate(Bundle savedInstanceState) { final Context context = this;

super.onCreate(savedInstanceState);

setContentView(R.layout.layout_enterapp);

btnTampilPeta = (Button) findViewById(R.id.button1);

btnCariRuteTerpendek = (Button) findViewById(R.id.button2); btnCaraPenggunaan = (Button) findViewById(R.id.button3); btnTampilPeta.setOnClickListener(new OnClickListener() { @Override

public void onClick(View arg0) {

Intent intent = new Intent(context, TampilPeta.class); startActivity(intent); } });

btnCariRuteTerpendek.setOnClickListener(new OnClickListener()) { @Override

public void onClick(View arg0) {

Intent intent = new Intent(context, PilihVerteks.class); startActivity(intent); } });

(6)

public void onClick(View arg0) {

Intent intent = new Intent(context, CaraPenggunaan.class); startActivity(intent); } }); } }

layout_enterapp.xml

<LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="horizontal|vertical" android:orientation="vertical" > <TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView2"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/opsi"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/artiopsi"

android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <Button android:id="@+id/button1"

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/showmap" />

<Button android:id="@+id/button2"

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/findpath" />

<Button android:id="@+id/button3"

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/backhowto" />

</LinearLayout>

TampilPeta.java

package com.mobilegisdijkstra; import com.mobilegisdijkstra.R; import android.os.Bundle;

(7)

import android.view.MotionEvent;

import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation;

import android.view.animation.TranslateAnimation; import android.webkit.WebView;

import android.widget.ViewFlipper;

public class TampilPeta extends Activity { private ViewFlipper vf;

private WebView webView; private float oldTouchValue;

@SuppressLint("SetJavaScriptEnabled") @Override

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

setContentView(R.layout.layout_vf_showmap); vf=(ViewFlipper)findViewById(R.id.ViewFlipper01); webView = (WebView) findViewById(R.id.webView2); webView.getSettings().setJavaScriptEnabled(true);

webView.loadUrl("http://10.0.2.2:8081/geoserver/workspaceUSU/wms?servic e=WMS&version=1.1.0&request=GetMap&layers=grupUSU&styles=&bbox= 6.222626893282417,4.485378590078277,426.6114958610236,566.11317665 02311&width=1212&height=572&srs=EPSG:23845&format=application/ope nlayers"); }

@Override

public boolean onTouchEvent(MotionEvent touchevent) { switch (touchevent.getAction()) {

case MotionEvent.ACTION_DOWN: { oldTouchValue = touchevent.getX(); break; }

case MotionEvent.ACTION_UP: { float currentX = touchevent.getX(); if (oldTouchValue < currentX) {

vf.setInAnimation(inFromLeftAnimation()); vf.setOutAnimation(outToRightAnimation()); vf.showNext(); }

if (oldTouchValue > currentX) {

vf.setInAnimation(inFromRightAnimation()); vf.setOutAnimation(outToLeftAnimation()); vf.showPrevious(); }

break; } } return false; }

(8)

Animation inFromRight = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); inFromRight.setDuration(350);

inFromRight.setInterpolator(new AccelerateInterpolator()); return inFromRight; }

public static Animation outToLeftAnimation() { Animation outtoLeft = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); outtoLeft.setDuration(350);

outtoLeft.setInterpolator(new AccelerateInterpolator()); return outtoLeft; }

public static Animation inFromLeftAnimation() { Animation inFromLeft = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); inFromLeft.setDuration(350);

inFromLeft.setInterpolator(new AccelerateInterpolator()); return inFromLeft; }

public static Animation outToRightAnimation() { Animation outtoRight = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); outtoRight.setDuration(350);

outtoRight.setInterpolator(new AccelerateInterpolator()); return outtoRight; } }

layout_vf_showmap.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"

(9)

android:layout_width="fill_parent" android:layout_height="fill_parent" > <include android:id="@+id/libraryView1"

layout="@layout/layout_vf_showmap_map" /> <include android:id="@+id/libraryView2" layout="@layout/layout_vf_showmap_legend" /> </ViewFlipper>

</RelativeLayout>

layout_vf_showmap_legend.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >

<Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/dragshowmap" />

<LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="120dp" >

<Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#FF0000"

android:textColor="#000000" />

<Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fkedokteran" />

<Button android:id="@+id/button4" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#CCCCCC"

android:textColor="#000000" />

<Button android:id="@+id/button5" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/filkom" />

<Button android:id="@+id/button6" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#CCFFFF"

android:textColor="#000000" />

<Button android:id="@+id/button7" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fbudaya" />

(10)

<LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="180dp" >

<Button android:id="@+id/button8" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#666666"

android:textColor="#000000" />

<Button android:id="@+id/button9" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fhukum" />

<Button android:id="@+id/button10" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#000033"

android:textColor="#000000" />

<Button android:id="@+id/button11" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fmipa" />

<Button android:id="@+id/button12" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#6600CC"

android:textColor="#000000" />

<Button android:id="@+id/button13" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fpsikologi" />

</LinearLayout> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="240dp" >

<Button android:id="@+id/button14" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#FFCC00"

android:textColor="#000000" />

<Button android:id="@+id/button15" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fkeperawatan" />

<Button android:id="@+id/button16" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#FF00FF"

android:textColor="#000000" />

(11)

android:text="@string/fkm" />

<Button android:id="@+id/button18" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#993300"

android:textColor="#000000" />

<Button android:id="@+id/button19" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fteknik" />

</LinearLayout> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="300dp" >

<Button android:id="@+id/button20" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#9933FF"

android:textColor="#000000" />

<Button android:id="@+id/button21" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fpertanian" />

<Button android:id="@+id/button22" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#660000"

android:textColor="#000000" />

<Button android:id="@+id/button23" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fekonomi" />

<Button android:id="@+id/button24" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#CC0099"

android:textColor="#000000" />

<Button android:id="@+id/button25" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fsospol" />

</LinearLayout> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="360dp" >

<Button android:id="@+id/button26" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#996699"

(12)

<Button android:id="@+id/button27" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/fkedokterangigi" />

<Button android:id="@+id/button28" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#000066"

android:textColor="#000000" />

<Button android:id="@+id/button29" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/birek" />

<Button android:id="@+id/button30" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#009900"

android:textColor="#000000" />

<Button android:id="@+id/button31" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/audit" />

</LinearLayout> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="420dp" >

<Button android:id="@+id/button32" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#0066CC"

android:textColor="#000000" />

<Button android:id="@+id/button33" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/stadion" />

<Button android:id="@+id/button34" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#66FF99"

android:textColor="#000000" />

<Button android:id="@+id/button35" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/poliklinik" />

<Button android:id="@+id/button36" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#990066"

android:textColor="#000000" />

(13)

</LinearLayout> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="480dp" >

<Button android:id="@+id/button38" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#999933"

android:textColor="#000000" />

<Button android:id="@+id/button39" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/perpus" />

<Button android:id="@+id/button40" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#CC9900"

android:textColor="#000000" />

<Button android:id="@+id/button41" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/pendopo" />

<Button android:id="@+id/button42" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sign" android:background="#CCCC00"

android:textColor="#000000" />

<Button android:id="@+id/button43" style="?android:attr/buttonStyleSmall" android:layout_width="360dp" android:layout_height="wrap_content" android:text="@string/gema" />

</LinearLayout>

<TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginTop="60dp" android:text="@string/legend"

android:textAppearance="?android:attr/textAppearanceLarge" /> </RelativeLayout>

layout_vf_showmap_map.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools="http://schemas.android.com/tools"

tools:context=".ReLayoutShowMap_Map" android:layout_width="match_parent" android:layout_height="match_parent">

(14)

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true"

android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:text="@string/dragshowlegend" /> <TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/button1"

android:layout_centerHorizontal="true" android:text="@string/usumap"

android:textAppearance="?android:attr/textAppearanceLarge" /> <WebView android:id="@+id/webView2"

android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerHorizontal="true"

android:layout_marginBottom="10dp"

android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="80dp" />

</RelativeLayout>

PilihVerteks.java

package com.mobilegisdijkstra; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View;

import android.view.View.OnClickListener; import android.widget.AdapterView;

import android.widget.AdapterView.OnItemSelectedListener; import android.widget.Button;

import android.widget.Spinner; import android.widget.TextView; import android.widget.ArrayAdapter;

public class PilihVerteks extends Activity { TextView tvIDTitikAwal;

TextView tvIDTitikAkhir; Spinner spinTitikAwal; Spinner spinTitikAkhir; Button btndijkstra;

(15)

@Override

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

setContentView(R.layout.layout_chooseverteks);

tvIDTitikAwal = (TextView) findViewById(R.id.textView12); tvIDTitikAkhir = (TextView) findViewById(R.id.textView13); spinTitikAwal = (Spinner) findViewById(R.id.spinner1); spinTitikAkhir = (Spinner) findViewById(R.id.spinner2); btndijkstra = (Button) findViewById(R.id.button1); btndijkstra.setOnClickListener(listenerdijkstra); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,

R.array.fakultas_array,android.R.layout.simple_spinner_dropdown_item); spinTitikAwal.setAdapter(adapter);

spinTitikAkhir.setAdapter(adapter);

spinTitikAwal.setOnItemSelectedListener(listener1); spinTitikAkhir.setOnItemSelectedListener(listener2); }

public OnItemSelectedListener listener1 = new OnItemSelectedListener() { @Override

public void onItemSelected

(AdapterView<?> parent, View view, int pos, long id) {

String ids [] = getResources().getStringArray(R.array.id_array); nilai_id1 = ids [pos];

tvIDTitikAwal.setText(nilai_id1); } @Override

public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } };

public OnItemSelectedListener listener2 = new OnItemSelectedListener() { @Override

public void onItemSelected

(AdapterView<?> parent, View view, int pos, long id) {

String ids [] = getResources().getStringArray(R.array.id_array); nilai_id2 = ids [pos];

tvIDTitikAkhir.setText(nilai_id2); } @Override

public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } };

public OnClickListener listenerdijkstra = new OnClickListener() { @Override

public void onClick(View arg0) {

(16)

intent.putExtra("ttkawl", tvIDTitikAwal.getText().toString()); intent.putExtra("ttkakr", tvIDTitikAkhir.getText().toString()); startActivity(intent); } }; }

layout_chooseverteks.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="horizontal|vertical" android:orientation="vertical" > <TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView2"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/choosevertex"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView3"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/artichoosevertex" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView5"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/vstart"

android:textAppearance="?android:attr/textAppearanceLarge" /> <Spinner android:id="@+id/spinner1"

android:layout_width="match_parent" android:layout_height="wrap_content" /> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/textView11"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/vid"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView12"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

(17)

</LinearLayout>

<TextView android:id="@+id/textView6"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView7"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/vend"

android:textAppearance="?android:attr/textAppearanceLarge" /> <Spinner android:id="@+id/spinner2"

android:layout_width="match_parent" android:layout_height="wrap_content" /> <LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/textView9"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/vid"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView13"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> </LinearLayout>

<TextView android:id="@+id/textView8"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=""

android:textAppearance="?android:attr/textAppearanceLarge" /> <Button android:id="@+id/button1"

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/fsp" />

</LinearLayout>

HasilProsesDijkstra.java

package com.mobilegisdijkstra; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List;

import java.util.PriorityQueue;

(18)

import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document;

import org.w3c.dom.Element; import org.w3c.dom.NodeList;

import com.mobilegisdijkstra.model.Edge; import com.mobilegisdijkstra.model.Verteks; import com.mobilegisdijkstra.PilihVerteks; import android.content.res.AssetManager; import android.os.Bundle;

import android.view.MotionEvent;

import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation;

import android.view.animation.TranslateAnimation; import android.webkit.WebView;

import android.widget.TextView; import android.annotation.SuppressLint; import android.widget.ViewFlipper;

public class HasilProsesDijkstra extends PilihVerteks { TextView hasil, jarak;

private WebView wvPeta; private ViewFlipper vf; private float oldTouchValue;

public void cariJalurDijkstra(Verteks asal) { asal.jarakTerpendek = 0.;

PriorityQueue<Verteks> antrianVerteks = new PriorityQueue<Verteks>(); antrianVerteks.add(asal);

while (!antrianVerteks.isEmpty()) { Verteks u = antrianVerteks.poll(); for (Edge e : u.tetangga) {

Verteks v = e.tujuan; double bobot = e.bobot;

double jarakMelewatiU = u.jarakTerpendek + bobot; if (jarakMelewatiU < v.jarakTerpendek) {

antrianVerteks.remove(v);

v.jarakTerpendek = jarakMelewatiU ; v.previous = u;

antrianVerteks.add(v); } } } }

public List<Verteks> cariJalurTerpendekKe(Verteks tujuan) { List<Verteks> jalur = new ArrayList<Verteks>();

for (Verteks verteks = tujuan; verteks != null; verteks = verteks.previous) jalur.add(verteks);

(19)

return jalur; }

public int parseString(String s) { return Integer.parseInt(s); }

public Verteks[] parsingVerteks(String XMLName) { try {

DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();

DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); AssetManager assetManager = getAssets();

InputStream fileInputStream = assetManager.open(XMLName); Document doc = dBuilder.parse(fileInputStream);

doc.getDocumentElement().normalize();

NodeList nlVerteks = doc.getElementsByTagName("Vertex"); NodeList nlChildVerteks;

Verteks[] nVertices = new Verteks[nlVerteks.getLength()]; NodeList nListEdge;

NodeList nListChildEdge; String idVerteks;

String namaVerteks; String idEdge; String namaEdge; String jarak;

for (int indeksVerteks = 0 ; indeksVerteks < nlVerteks.getLength(); indeksVerteks++) {

Element eVertex = (Element) nlVerteks.item(indeksVerteks); nlChildVerteks = eVertex.getChildNodes();

idVerteks = nlChildVerteks.item(1).getTextContent(); namaVerteks = nlChildVerteks.item(3).getTextContent();

nVertices[indeksVerteks] = new Verteks(idVerteks, namaVerteks); } for (int indeksVerteks = 0 ; indeksVerteks < nlVerteks.getLength(); indeksVerteks++) {

Element eVertex = (Element) nlVerteks.item(indeksVerteks); nListEdge = eVertex.getElementsByTagName("Edge"); Edge[] arrayEdge = new Edge[nListEdge.getLength()];

for (int indexEdge = 0 ; indexEdge < nListEdge.getLength() ; indexEdge++) { Element eEdge = (Element) nListEdge.item(indexEdge);

nListChildEdge = eEdge.getChildNodes();

idEdge = nListChildEdge.item(1).getTextContent(); namaEdge = nListChildEdge.item(3).getTextContent(); jarak = nListChildEdge.item(5).getTextContent();

arrayEdge[indexEdge] = new Edge(nVertices[parseString(idEdge)], parseString(jarak), namaEdge); }

(20)

System.arraycopy(arrayEdge, 0, nVertices[indeksVerteks].tetangga, 0, arrayEdge.length); }

return nVertices; } catch(Exception e) { e.printStackTrace(); } return null; }

@SuppressLint("SetJavaScriptEnabled")

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

setContentView(R.layout.layout_vf_result);

vf=(ViewFlipper)findViewById(R.id.ViewFlipper02); hasil = (TextView) findViewById(R.id.textView12); jarak = (TextView) findViewById(R.id.textView30); wvPeta = (WebView) findViewById(R.id.webView2); wvPeta.getSettings().setJavaScriptEnabled(true); Bundle extras = getIntent().getExtras();

int titikAwal = parseString(extras.getString("titikAwal")); int titikAkhir = parseString(extras.getString("titikAkhir")); String grafisVerteksAwal = extras.getString("ttkawl"); String grafisVerteksAkhir = extras.getString("ttkakr"); String urlVerteks =

"nodeawal:"+grafisVerteksAwal+";nodeakhir:"+grafisVerteksAkhir+";"; Verteks[] verteksGraf = parsingVerteks("Graph.xml");

cariJalurDijkstra(verteksGraf[titikAwal]);

List<Verteks> jalur = cariJalurTerpendekKe(verteksGraf[titikAkhir]); hasil.setText(jalur.toString());

jarak.setText("" + verteksGraf[titikAkhir].jarakTerpendek); String vSekarang;

String vSelanjutnya; Verteks V;

Edge [] kumpulanEdge;

String[] jalurEdge = new String[jalur.size()-1]; int indeksJalur = 0;

for (int i=0 ; i< jalur.size()-1; i++) { vSekarang = jalur.get(i).getId(); vSelanjutnya = jalur.get(i+1).getId(); V = verteksGraf[parseString(vSekarang)]; kumpulanEdge = V.tetangga;

for (int j = 0 ; j <kumpulanEdge.length; j++) { if (kumpulanEdge[j].tujuan.id == vSelanjutnya) { jalurEdge[indeksJalur] = kumpulanEdge[j].name; indeksJalur++;

(21)

String urlEdge= "&env=";

for (int i = 0 ; i < jalurEdge.length; i++) { urlEdge+="edge"+(i+1)+":"+jalurEdge[i]+";"; } String urlPeta =

"http://10.0.2.2:8081/geoserver/workspaceUSU/wms?service=WMS&version= 1.1.0&request=GetMap&layers=grupUSU&styles=&bbox=6.2226268932824 17,4.485378590078277,426.6114958610236,566.1131766502311&width=121 2&height=562&srs=EPSG:23845&format=application/openlayers";

wvPeta.loadUrl(urlPeta + urlEdge + urlVerteks); } @Override

public boolean onTouchEvent(MotionEvent touchevent) { switch (touchevent.getAction()) {

case MotionEvent.ACTION_DOWN: { oldTouchValue = touchevent.getX(); break; }

case MotionEvent.ACTION_UP: { float currentX = touchevent.getX(); if (oldTouchValue < currentX) {

vf.setInAnimation(inFromLeftAnimation()); vf.setOutAnimation(outToRightAnimation()); vf.showNext(); }

if (oldTouchValue > currentX) {

vf.setInAnimation(inFromRightAnimation()); vf.setOutAnimation(outToLeftAnimation()); vf.showPrevious(); }

break; } } return false; }

public static Animation inFromRightAnimation() { Animation inFromRight = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); inFromRight.setDuration(350);

inFromRight.setInterpolator(new AccelerateInterpolator()); return inFromRight; }

(22)

outtoLeft.setInterpolator(new AccelerateInterpolator()); return outtoLeft; }

public static Animation inFromLeftAnimation() { Animation inFromLeft = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); inFromLeft.setDuration(350);

inFromLeft.setInterpolator(new AccelerateInterpolator()); return inFromLeft; }

public static Animation outToRightAnimation() { Animation outtoRight = new TranslateAnimation ( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f ); outtoRight.setDuration(350);

outtoRight.setInterpolator(new AccelerateInterpolator()); return outtoRight; } }

layout_vf_result.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation="vertical"

android:layout_width="fill_parent" android:layout_height="fill_parent">

<ViewFlipper android:id="@+id/ViewFlipper02" android:layout_width="fill_parent"

android:layout_height="fill_parent" > <include android:id="@+id/libraryView3" layout="@layout/layout_vf_result_map" /> <include android:id="@+id/libraryView4" layout="@layout/layout_vf_result_string" /> <include android:id="@+id/libraryView4" layout="@layout/layout_vf_result_distance" /> </ViewFlipper>

</RelativeLayout>

layout_vf_result_distance.xml

(23)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >

<LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" >

<Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.50"

android:text="@string/dragresult_distancemap" />

<Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.50"

android:text="@string/dragresult_distancestring" /> </LinearLayout>

<TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="10dp"

android:text="@string/resultdistance"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView30"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="60dp"

android:text="" android:textSize="150sp"

android:textAppearance="?android:attr/textAppearanceLarge"/> <TextView android:id="@+id/textView2"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/meter"

android:textAppearance="?android:attr/textAppearanceLarge" android:textSize="60sp" />

</LinearLayout>

layout_vf_result_map.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >

<LinearLayout

(24)

<Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.50"

android:text="@string/dragresult_mapdistance" /> </LinearLayout>

<TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="10dp"

android:text="@string/resultmap"

android:textAppearance="?android:attr/textAppearanceLarge" /> <WebView android:id="@+id/webView2"

android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" /> </LinearLayout>

layout_vf_result_string.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >

<LinearLayout

android:layout_width="match_parent" android:layout_height="wrap_content" >

<Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.50"

android:text="@string/dragresult_stringdistance" />

<Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.50"

android:text="@string/dragresult_stringmap" /> </LinearLayout>

<TextView android:id="@+id/textView1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="10dp"

android:text="@string/resultstring"

android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/textView12"

(25)

android:text="" android:textSize="40sp"

android:textAppearance="?android:attr/textAppearanceLarge"/> </LinearLayout>

Edge.java

package com.mobilegisdijkstra.model; import com.mobilegisdijkstra.model.Verteks;

public class Edge {

public final Verteks tujuan; public final int bobot; public final String name;

public Edge(Verteks argTujuan, int argBobot, String argName) { tujuan = argTujuan; bobot = argBobot; name = argName; } }

Verteks.java

package com.mobilegisdijkstra.model; import com.mobilegisdijkstra.model.Edge; import com.mobilegisdijkstra.model.Verteks;

public class Verteks implements Comparable<Verteks> { public final String name;

public final String id; public Edge[] tetangga;

public double jarakTerpendek = Double.POSITIVE_INFINITY; public Verteks previous;

public Verteks(String argId, String argName) { name = argName;

id = argId; }

public String toString() { return name; } public String getId() { return id; } public int compareTo(Verteks other) {

return Double.compare(jarakTerpendek, other.jarakTerpendek); } }

listview.xml

<?xml version="1.0" encoding="utf-8"?> <!-- listview.xml -->

<resources>

(26)

<item>Gerbang I</item>

<item>Persimpangan Jl. Universitas - Jl. Alumni</item> <item>Persimpangan Jalan Alternatif 1 - Jl. Universitas</item> <item>Fakultas Hukum</item>

<item>Persimpangan Jl. Universitas - Jl. Prof Dr Sofian</item> <item>Persimpangan Jl. Prof. Dr. Sofian - Jl. TM Hanafiah</item> <item>Persimpangan Jl. Tridarma - Jl. Prof. Dr. Sofian</item> <item>Persimpangan Jl. Tridarma - Jl. Bioteknologi</item> <item>Persimpangan Jl. Tridarma - Jl. Politeknik</item> <item>Gerbang IV</item>

<item>Gerbang III</item> <item>Gerbang II</item>

<item>Fakultas Kedokteran Gigi</item>

<item>Persimpangan Jl. Alumni - Jl. Sivitas Academica</item> <item>Persimpangan Jl. Alumni - Jl. Almamater</item>

<item>Persimpangan Jl. Politeknik - Jl. Almamater</item> <item>Persimpangan Jalan Alternatif 1 - Jl. Perpustakaan</item> <item>

Persimpangan Jl. Perpustakaan - Jl. Abdul Hakim / Perpustakaan </item>

<item>Persimpangan Jl. Almamater - Jl. Bioteknologi</item> <item>Fakultas Kedokteran</item>

<item>Fakultas Psikologi</item>

<item>Persimpangan Jl. Universitas - Jl. Alternatif 2</item> <item>Fakultas Keperawatan</item>

<item>Fakultas Kesehatan Masyarakat</item> <item>Gelanggang Mahasiswa</item>

<item>Fakultas Ilmu Komputer dan Teknologi Informasi</item>

<item>Persimpangan Jl. Almamater - Jalan Alternatif Biro Rektor</item> <item>Biro Rektor</item>

<item>

Persimpangan Jl. Sivitas Academica - Jalan Alternatif Biro Rektor </item>

<item>Auditorium</item> <item>Fakultas Teknik</item>

<item>Fakultas Matematika dan Ilmu Pengetahuan Alam</item> <item>Fakultas Farmasi</item>

<item>Politeknik Negeri Medan</item> <item>Stadion Mini</item>

<item>Pendopo</item>

<item>Fakultas Ilmu Budaya</item> <item>Fakultas Ekonomi</item>

(27)

<item>Fakultas Pertanian</item> <item>Poliklinik</item>

</string-array>

<string-array name="id_array"> <item>0</item>

(28)

<item>38</item> <item>39</item> <item>40</item> </string-array> </resources>

strings.xml

<?xml version="1.0" encoding="utf-8"?> <resources>

<string name="app_name">MobileGISDijkstra</string> <string name="action_settings">Settings</string> <string name="hello_world">Hello world!</string>

<string name="title">Geographic Information System Mobile</string> <string name="subtitle">- dijkstra implementation -</string>

<string name="enter">ENTER</string>

<string name="howtouse">HOW TO USE</string> <string name="about">ABOUT</string>

<string name="usu">University of Sumatera Utara</string> <string name="judul1">

Implementasi Algoritma Dijkstra Untuk Menentukan Rute Terpendek Berbasis Mobile GIS

</string>

<string name="judul2">Studi Kasus : Universitas Sumatera Utara</string> <string name="content">Contents (isi)</string>

<string name="artiabout">( Tentang Program / Aplikasi )</string> <string name="artihowtouse">( Cara Penggunaan )</string> <string name="opsi">Option</string>

<string name="artiopsi">( Tentukan Pilihan )</string>

<string name="showmap">Show Map (Tampilkan Peta)</string> <string name="findpath">

Find Shortest Path (Temukan Rute Terpendek) </string>

<string name="backhowto">How To Use (Cara Penggunaan)</string> <string name="legend">Legend</string>

<string name="artilegend">(Petunjuk Peta)</string> <string name="usumap">USU Map</string>

<string name="artiusumap">(Peta Universitas Sumatera Utara)</string> <string name="space">[+]</string>

<string name="fkedokteran">F. Kedokteran</string> <string name="filkom">F. Ilkom TI</string>

(29)

<string name="fmipa">F. MIPA</string>

<string name="fpsikologi">F. Psikologi</string> <string name="fkeperawatan">F. Keperawatan</string> <string name="fkm">F. Kes. Masyarakat</string> <string name="fteknik">F. Teknik</string> <string name="fpertanian">F. Pertanian</string> <string name="fekonomi">F. Ekonomi</string> <string name="fsospol">F. Sosial Politik</string> <string name="fkedokterangigi">F. Ked. Gigi</string> <string name="birek">Biro Rektor</string>

<string name="audit">Auditorium</string> <string name="stadion">Stadion Mini</string> <string name="poliklinik">Poliklinik</string>

<string name="politeknik">Politeknik Medan</string> <string name="perpus">Perpustakaan</string>

<string name="pendopo">Pendopo</string> <string name="gema">G. Mahasiswa</string>

<string name="choosevertex">Choose Vertexes</string> <string name="artichoosevertex">(Pilih Node)</string> <string name="vstart">Start Vertex (Node Awal) :</string> <string name="vend">End Vertex (Node Akhir) :</string> <string name="fsp">Find Shortest Path</string>

<string name="vid">Vertex ID :</string>

<string name="result">Dijkstra Shortest Path Result</string> <string name="artiresult">

(Hasil Perhitungan Rute Terpendek Dijkstra) </string>

<string name="stringpath">String Path :</string> <string name="o">o</string>

<!-- isi about -->

<string name="isiabout">

Aplikasi ini adalah program MobileGIS perangkat Android \n yang mengimplementasikan Algoritma Dijkstra

\n sehingga dapat digunakan untuk mencari rute terpendek pada lingkungan \n Universitas Sumatera Utara.

</string>

<!-- isi howtouse -->

<string name="isihowtouse">

Panduan Khusus Mencari Rute Terpendek \n

\n1. Pilih ENTER pada halaman utama. \n

(30)

\n 2.1. Show Map, untuk menampilkan peta. Gunakan pilihan ini untuk referensi Node.

\n 2.2. Find Shortest Path, untuk masuk ke proses pemilihan titik awal dan titik tujuan.

\n 2.3. How To Use, untuk kembali ke halaman ini. \n Pilih "Find Shortest Path".

\n

\n3. Pilih "Node Awal" dan "Node Akhir". Kemudian tekan tombol "Find Shortest Path".

\n

\n4. Akan ditampilkan peta hasil perhitungan Dijkstra dengan tambahan sebagai berikut :

\n 4.1. Titik / Node (berwarna) hijau, sebagai Node Awal.

\n 4.2. Garis - garis / Edge (berwarna) kuning, sebagai jalan yang harus dilalui.

\n 4.3. Titik / Node (berwarna) merah, sebagai Node Akhir atau Node Tujuan. \n 4.4. String Path, sebagai informasi rute terpendek berbentuk Teks dengan \n Total Jarak yang harus ditempuh (dalam satuan meter).

</string>

<string name="dragshowlegend"> Drag LEFT or RIGHT To Show Legend </string>

<string name="dragshowmap">Drag LEFT or RIGHT To Show Map</string> <string name="sign">[ -+- ]</string>

<string name="dragresult_mapstring"> Drag LEFT to Show String Result </string>

<string name="dragresult_mapdistance"> Drag RIGHT to Show Max Distance </string>

<string name="dragresult_stringdistance"> Drag LEFT to Show Max Distance

</string>

<string name="dragresult_stringmap"> Drag RIGHT to Show Map Result </string>

<string name="dragresult_distancemap"> Drag LEFT to Show Map Result

</string>

<string name="dragresult_distancestring"> Drag RIGHT to Show String Result

(31)

<string name="resultmap">Map Result</string> <string name="resultstring">String Result</string>

<string name="resultdistance">Maximum Distance</string> <string name="meter">METERS</string>

</resources>

• Graph.xml

<?xml version="1.0" encoding="ISO-8859-1"?> <Graph>

<Vertex> <id>0</id> <Name>

Gerbang I </Name>

<Edge><id>19</id><garis>Jln25</garis><Distance>50</Distance></Edge> <Edge><id>21</id><garis>Jln32</garis><Distance>50</Distance></Edge> </Vertex>

<Vertex> <id>1</id> <Name>

Persimpangan Jl. Universitas - Jl. Alumni </Name>

<Edge><id>24</id><garis>Jln30</garis><Distance>50</Distance></Edge> <Edge><id>25</id><garis>Jln12</garis><Distance>50</Distance></Edge> <Edge><id>12</id><garis>Jln01</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex> <id>2</id> <Name>

Persimpangan Jalan Alternatif 1 - Jl. Universitas </Name>

<Edge><id>25</id><garis>Jln33</garis><Distance>50</Distance></Edge> <Edge><id>35</id><garis>Jln17</garis><Distance>100</Distance></Edge> <Edge><id>16</id><garis>Jln13</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex> <id>3</id> <Name>

Fakultas Hukum </Name>

(32)

<Edge><id>17</id><garis>Jln19</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex> <id>4</id> <Name>

Persimpangan Jl. Universitas - Jl. Prof. Dr. Sofian </Name>

<Edge><id>38</id><garis>Jln24</garis><Distance>500</Distance></Edge> <Edge><id>3</id><garis>Jln22</garis><Distance>300</Distance></Edge> </Vertex>

<Vertex> <id>5</id> <Name>

Persimpangan Jl. Prof. Dr. Sofian - Jl. TM Hanafiah </Name>

<Edge><id>38</id><garis>Jln47</garis><Distance>100</Distance></Edge> <Edge><id>37</id><garis>Jln23</garis><Distance>100</Distance></Edge> <Edge><id>6</id><garis>Jln21</garis><Distance>300</Distance></Edge> </Vertex>

<Vertex> <id>6</id> <Name>

Persimpangan Jl. Tridarma - Jl. Prof. Dr. Sofian </Name>

<Edge><id>39</id><garis>Jln20</garis><Distance>100</Distance></Edge> <Edge><id>5</id><garis>Jln21</garis><Distance>300</Distance></Edge> </Vertex>

<Vertex> <id>7</id> <Name>

Persimpangan Jl. Tridarma - Jl. Bioteknologi </Name>

<Edge><id>32</id><garis>Jln41</garis><Distance>100</Distance></Edge> <Edge><id>39</id><garis>Jln48</garis><Distance>200</Distance></Edge> <Edge><id>31</id><garis>Jln18</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex> <id>8</id> <Name>

Persimpangan Jl. Tridarma - Jl. Politeknik </Name>

(33)

<Edge><id>15</id><garis>Jln10</garis><Distance>300</Distance></Edge> </Vertex>

<Vertex> <id>9</id> <Name>

Gerbang IV </Name>

<Edge><id>34</id><garis>Jln42</garis><Distance>100</Distance></Edge> <Edge><id>10</id><garis>Jln09</garis><Distance>300</Distance></Edge> </Vertex>

<Vertex><id>10</id> <Name>

Gerbang III </Name>

<Edge><id>9</id><garis>Jln09</garis><Distance>300</Distance></Edge> <Edge><id>11</id><garis>Jln06</garis><Distance>300</Distance></Edge> <Edge><id>26</id><garis>Jln36</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex><id>11</id> <Name>

Gerbang II </Name>

<Edge><id>20</id><garis>Jln27</garis><Distance>50</Distance></Edge> <Edge><id>10</id><garis>Jln06</garis><Distance>300</Distance></Edge> </Vertex>

<Vertex><id>12</id> <Name>

Fakultas Kedokteran Gigi </Name>

<Edge><id>1</id><garis>Jln01</garis><Distance>200</Distance></Edge> <Edge><id>16</id><garis>Jln11</garis><Distance>100</Distance></Edge> <Edge><id>13</id><garis>Jln05</garis><Distance>100</Distance></Edge> </Vertex>

<Vertex><id>13</id> <Name>

Persimpangan Jl. Alumni - Jl. Sivitas Academica </Name>

(34)

<Edge><id>29</id><garis>Jln38</garis><Distance>150</Distance></Edge> </Vertex>

<Vertex><id>14</id> <Name>

Persimpangan Jl. Alumni - Jl. Almamater </Name>

<Edge><id>15</id><garis>Jln04</garis><Distance>50</Distance></Edge> <Edge><id>29</id><garis>Jln08</garis><Distance>150</Distance></Edge> </Vertex>

<Vertex><id>15</id> <Name>

Persimpangan Jl. Politeknik - Jl. Almamater </Name>

<Edge><id>14</id><garis>Jln04</garis><Distance>50</Distance></Edge> <Edge><id>8</id><garis>Jln10</garis><Distance>300</Distance></Edge> <Edge><id>30</id><garis>Jln39</garis><Distance>100</Distance></Edge> </Vertex>

<Vertex><id>16</id> <Name>

Persimpangan Jalan Alternatif 1 - Jl. Perpustakaan </Name>

<Edge><id>2</id><garis>Jln13</garis><Distance>200</Distance></Edge> <Edge><id>12</id><garis>Jln11</garis><Distance>100</Distance></Edge> <Edge><id>17</id><garis>Jln16</garis><Distance>400</Distance></Edge> </Vertex>

<Vertex><id>17</id> <Name>

Persimpangan Jl. Perpustakaan - Jl. Abdul Hakim / Perpustakaan </Name>

<Edge><id>3</id><garis>Jln19</garis><Distance>200</Distance></Edge> <Edge><id>16</id><garis>Jln16</garis><Distance>400</Distance></Edge> </Vertex>

<Vertex><id>18</id> <Name>

Persimpangan Jl. Almamater - Jl. Bioteknologi </Name>

(35)

<Edge><id>37</id><garis>Jln46</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex><id>19</id> <Name>

Fakultas Kedokteran </Name>

<Edge><id>0</id><garis>Jln25</garis><Distance>50</Distance></Edge> <Edge><id>20</id><garis>Jln26</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex><id>20</id> <Name>

Fakultas Psikologi </Name>

<Edge><id>11</id><garis>Jln27</garis><Distance>50</Distance></Edge> <Edge><id>19</id><garis>Jln26</garis><Distance>200</Distance></Edge> </Vertex>

<Vertex><id>21</id> <Name>

Persimpangan Jl. Universitas - Jl. Prof. MMAI </Name>

<Edge><id>0</id><garis>Jln32</garis><Distance>50</Distance></Edge> <Edge><id>23</id><garis>Jln28</garis><Distance>100</Distance></Edge> <Edge><id>40</id><garis>Jln31</garis><Distance>150</Distance></Edge> </Vertex>

<Vertex><id>22</id> <Name>

Fakultas Keperawatan </Name>

<Edge><id>23</id><garis>Jln29</garis><Distance>50</Distance></Edge> </Vertex>

<Vertex><id>23</id> <Name>

Fakultas Kesehatan Masyarakat </Name>

Figur

Memperbarui...

Referensi

Memperbarui...