• Tidak ada hasil yang ditemukan

Aplikasi Sistem Informasi Objek Parawista Provinsi Sumatera Utara

N/A
N/A
Protected

Academic year: 2017

Membagikan "Aplikasi Sistem Informasi Objek Parawista Provinsi Sumatera Utara"

Copied!
44
0
0

Teks penuh

(1)

LAMPIRAN PROGRAM

Splashscreen.xml

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

xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"

android:layout_height="fill_parent" android:background="#689F38"

android:layout_gravity="center" android:id="@+id/lin_lay"

android:gravity="center">

<ImageView

android:id="@+id/splash" android:layout_width="200dp" android:layout_height="200dp"

android:background="@drawable/utama" />

</LinearLayout>

Activty_tes.xml

<RelativeLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

android:layout_height="fill_parent" android:background="#E3F2FD">

<ImageView

android:id="@+id/imageView13" android:layout_width="122dp" android:layout_height="99dp"

android:layout_above="@+id/textView13" android:layout_toLeftOf="@+id/imageView15" android:layout_toStartOf="@+id/imageView15" app:srcCompat="@drawable/logo1"

tools:layout_editor_absoluteX="9dp" tools:layout_editor_absoluteY="170dp" />

<ImageView

android:id="@+id/imageView14" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo2"

(2)

<ImageView

android:id="@+id/imageView15" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo3"

tools:layout_editor_absoluteX="253dp" tools:layout_editor_absoluteY="170dp" android:layout_alignTop="@+id/imageView13" android:layout_centerHorizontal="true" />

<ImageView

android:id="@+id/imageView16" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo4" tools:layout_editor_absoluteX="9dp" tools:layout_editor_absoluteY="305dp" android:layout_below="@+id/textView14" android:layout_toRightOf="@+id/textView13" android:layout_toEndOf="@+id/textView13" />

<TextView

android:textColor="#000000" android:id="@+id/textView13"

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

tools:layout_editor_absoluteX="44dp" tools:layout_editor_absoluteY="275dp" android:layout_centerVertical="true"

android:layout_toLeftOf="@+id/imageView15" android:layout_toStartOf="@+id/imageView15" android:layout_marginRight="34dp"

android:layout_marginEnd="34dp" />

<ImageView

android:id="@+id/imageView17" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo5"

android:layout_alignTop="@+id/imageView16" android:layout_alignLeft="@+id/imageView13" android:layout_alignStart="@+id/imageView13" />

<ImageView

android:id="@+id/imageView18" android:layout_width="180dp" android:layout_height="150dp" app:srcCompat="@drawable/atas"

android:layout_above="@+id/imageView13" android:layout_centerHorizontal="true" />

<TextView

android:textColor="#000000" android:id="@+id/textView14"

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

(3)

android:layout_centerHorizontal="true" />

<TextView

android:textColor="#000000" android:id="@+id/textView15"

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

android:layout_marginLeft="14dp" android:layout_marginStart="14dp"

android:layout_below="@+id/imageView14" android:layout_toRightOf="@+id/imageView18" android:layout_toEndOf="@+id/imageView18" />

<TextView

android:layout_marginLeft="7dp" android:textColor="#000000" android:id="@+id/textView16"

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

android:layout_below="@+id/imageView17" android:layout_alignLeft="@+id/textView13" android:layout_alignStart="@+id/textView13" />

<TextView

android:textColor="#000000" android:id="@+id/textView17"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/imageView16" android:layout_centerHorizontal="true" android:text="Body Mass Index" />

<ImageView

android:id="@+id/imageView19" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo6"

android:layout_below="@+id/textView15" android:layout_toRightOf="@+id/imageView16" android:layout_toEndOf="@+id/imageView16" />

<TextView

android:layout_marginLeft="4dp" android:textColor="#000000" android:id="@+id/textView18"

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

android:layout_below="@+id/imageView19" android:layout_toRightOf="@+id/imageView18" android:layout_toEndOf="@+id/imageView18" />

(4)

Activty_baby.xml

<LinearLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"

android:layout_height="fill_parent" android:background="#ffffff">

<ScrollView

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

<RelativeLayout

android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">

<ImageView

android:id="@+id/imageView5"

android:layout_width="match_parent" android:layout_height="300dp"

android:layout_gravity="center" app:srcCompat="@drawable/baby"

android:layout_above="@+id/textView10" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginBottom="30dp" />

<TextView

android:id="@+id/textView7"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView8" android:layout_marginLeft="5dp"

android:layout_marginTop="220dp"

android:text="Tips Agar Anak Cerdas Sejak Bayi" android:textAlignment="viewStart"

android:textColor="#000000" android:textSize="20sp" android:textStyle="bold" />

<TextView

android:id="@+id/textView9" android:layout_width="180dp"

android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView7" android:layout_marginLeft="187dp" android:layout_marginTop="10dp"

android:text="Cara Mengatasi Demam Pada Bayi" android:textColor="#000000"

(5)

android:textStyle="bold" />

<TextView

android:layout_marginLeft="187dp" android:id="@+id/textView10" android:layout_width="180dp"

android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView9" android:layout_marginTop="100dp"

android:text="Menangani Kejang Demam Pada Anak" android:textAlignment="viewStart"

android:textColor="#000000" android:textSize="15sp" android:textStyle="bold" />

<ImageView

android:id="@+id/imageView5" android:layout_width="180dp" android:layout_height="200dp" android:layout_gravity="center" app:srcCompat="@drawable/fever"

android:layout_alignTop="@+id/textView7" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" />

<ImageView

android:id="@+id/imageView5" android:layout_width="180dp" android:layout_height="200dp" android:layout_gravity="center" android:layout_marginTop="360dp" app:srcCompat="@drawable/step" />

<ImageView

android:id="@+id/imageView5" android:layout_width="180dp" android:layout_height="200dp" android:layout_gravity="center" android:layout_marginTop="498dp" app:srcCompat="@drawable/asi" />

<TextView

android:id="@+id/textView12" android:layout_width="180dp"

android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView9" android:layout_alignStart="@+id/textView9" android:layout_below="@+id/textView9" android:text="@string/fever"

android:textColor="#000000" />

<TextView

android:layout_marginLeft="187dp" android:textColor="#000000"

(6)

android:layout_height="wrap_content" android:text="@string/kejang"

android:layout_marginTop="433dp" />

<TextView

android:textSize="15sp" android:textStyle="bold"

android:layout_marginTop="540dp" android:layout_marginLeft="187dp" android:textColor="#000000"

android:id="@+id/textView20" android:layout_width="180dp"

android:layout_height="wrap_content"

android:text="Waktu Yang Tepat Dalam Memberikan ASI" />

<TextView

android:textColor="#000000"

android:layout_marginLeft="187dp" android:id="@+id/textView21" android:layout_width="180dp"

android:layout_height="wrap_content" android:layout_marginTop="582dp" android:text="@string/asi" />

<ImageView

android:layout_marginTop="650dp" android:id="@+id/imageView2" android:layout_width="180dp" android:layout_height="200dp"

app:srcCompat="@drawable/babyyellow" />

<TextView

android:layout_marginTop="680dp" android:layout_marginLeft="187dp" android:textStyle="bold"

android:textColor="#000000" android:textSize="15sp" android:id="@+id/textView22" android:layout_width="180dp"

android:layout_height="wrap_content"

android:text="Bayi Kuning: Apakah Kondisi Ini Berbahaya Bagi Si Kecil?" />

<TextView

android:layout_marginTop="740dp" android:layout_marginLeft="187dp" android:textColor="#000000"

android:id="@+id/textView23" android:layout_width="180dp"

android:layout_height="wrap_content" android:text="@string/kuning" />

</RelativeLayout> </ScrollView>

(7)

Activty_berat.xml

<RelativeLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

android:layout_height="fill_parent" android:background="#43A047">

<TextView

android:textSize="20sp" android:textStyle="bold" android:textColor="#ffffff" android:id="@+id/textView"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="48dp"

android:text="Berat Badan" />

<EditText

android:textColor="#000000"

android:background="@drawable/rounded_edittext" android:textAlignment="center"

android:id="@+id/weight" android:layout_width="100dp" android:layout_height="50dp"

android:layout_below="@+id/textView" android:layout_centerHorizontal="true" android:layout_marginTop="21dp"

android:ems="10"

android:inputType="number|numberDecimal"/>

<TextView

android:textSize="20sp" android:textStyle="bold" android:textColor="#ffffff" android:id="@+id/textView11"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/weight" android:layout_centerHorizontal="true" android:layout_marginTop="35dp"

android:text="Tinggi Badan" />

<EditText

android:textAlignment="center" android:textColor="#000000"

android:background="@drawable/rounded_edittext" android:id="@+id/height"

(8)

android:inputType="number|numberDecimal" android:layout_below="@+id/textView11" android:layout_centerHorizontal="true" />

<Button

android:background="@drawable/buttonshape" android:id="@+id/calc"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="calculateBMI"

android:text="Calculate"

android:layout_above="@+id/textView4" android:layout_centerHorizontal="true" android:layout_marginBottom="26dp" />

<TextView

android:gravity="center_vertical"

android:textAlignment="center" android:textSize="18sp"

android:textStyle="bold" android:textColor="#ffffff" android:id="@+id/result" android:layout_width="150dp" android:layout_height="100dp" android:layout_marginBottom="11dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" />

<TextView

android:textSize="15sp" android:textStyle="bold" android:textColor="#ffffff" android:id="@+id/textView4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/result" android:layout_centerHorizontal="true" android:layout_marginBottom="29dp" android:text="Result :" />

</RelativeLayout>

Activty_main.xml

<RelativeLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

android:layout_height="fill_parent" android:background="#689F38">

<ImageView

(9)

android:layout_width="180dp" android:layout_height="180dp" app:srcCompat="@drawable/utama" android:layout_marginTop="50dp" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />

<Button

android:id="@+id/angry_btn"

android:text="Get Started" android:textColor="#ffffff" android:textSize="20sp"

android:layout_width="270dp" android:layout_height="60dp"

android:background="@drawable/buttonshape" android:shadowColor="#4DA8A8A8"

android:shadowDx="0" android:shadowDy="0" android:shadowRadius="5"

android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="78dp" />

<TextView

android:textSize="20sp" android:textStyle="bold" android:id="@+id/textView2"

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

android:layout_centerVertical="true" android:layout_centerHorizontal="true" />

<TextView

android:textAlignment="center" android:textSize="20sp"

android:id="@+id/textView3"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="33dp"

android:text="You're going to do great things \nwith healthcare app!"

android:layout_below="@+id/textView2" android:layout_centerHorizontal="true" /> </RelativeLayout>

Activty_sport.xml

<LinearLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"

(10)

android:background="#000000">

<ScrollView

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

<RelativeLayout

android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">

<ImageView

android:id="@+id/imageView5"

android:layout_width="match_parent" android:layout_height="300dp"

android:layout_gravity="center" android:layout_marginTop="20dp"

app:srcCompat="@drawable/olahragapagi" />

<TextView

android:id="@+id/textView7"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView8" android:layout_marginTop="260dp"

android:text="5 Olahraga Sederhana Yang Sehat Dan Menyenangkan"

android:textAlignment="viewStart" android:textColor="#ffffff"

android:textSize="18dp" android:textStyle="bold" />

<TextView

android:id="@+id/textView9"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView7" android:layout_marginTop="290dp"

android:text="Manfaat Acro Yoga Bagi Kesehatan" android:textAlignment="viewStart"

android:textColor="#ffffff" android:textSize="18dp" android:textStyle="bold" />

<TextView

android:id="@+id/textView10"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView9" android:layout_marginTop="256dp"

(11)

Dilakukan di Rumah"

android:textAlignment="viewStart" android:textColor="#ffffff"

android:textSize="18dp" android:textStyle="bold" />

<TextView

android:id="@+id/textView8"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dp"

android:text="Bagaimana Olahraga Pagi Yang Benar ?"

android:textAlignment="viewStart" android:textColor="#ffffff"

android:textSize="18dp" android:textStyle="bold" />

<ImageView

android:id="@+id/imageView5"

android:layout_width="match_parent" android:layout_height="300dp"

android:layout_gravity="center" android:layout_marginTop="340dp" app:srcCompat="@drawable/footbal" />

<ImageView

android:id="@+id/imageView5"

android:layout_width="match_parent" android:layout_height="300dp"

android:layout_gravity="center" android:layout_marginTop="630dp" app:srcCompat="@drawable/yoga" />

<ImageView

android:id="@+id/imageView5"

android:layout_width="match_parent" android:layout_height="300dp"

android:layout_gravity="center" android:layout_marginTop="950dp" app:srcCompat="@drawable/home" />

</RelativeLayout> </ScrollView>

</LinearLayout>

Activty_tips.xml

<LinearLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"

(12)

<ScrollView

android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:background="@drawable/grey">

<LinearLayout

android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/grey" android:orientation="vertical">

<ImageView

android:layout_marginTop="30dp" android:id="@+id/imageView6"

android:layout_width="match_parent" android:layout_height="208dp"

android:layout_gravity="center" app:srcCompat="@drawable/toilet" />

<TextView

android:id="@+id/textView7"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="25dp"

android:text="Bahaya Menggunakan Tisu \ndi Dudukan Toilet"

android:textAlignment="center" android:textColor="#000000" android:textSize="20sp" android:textStyle="bold" />

<TextView

android:id="@+id/textView6"

android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:layout_marginTop="25dp" android:layout_weight="1"

android:text="@string/toilet" android:textColor="#000000" /> </LinearLayout>

</ScrollView> </LinearLayout>

Activty_tes.xml

<RelativeLayout

android:orientation="vertical"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

(13)

<ImageView

android:id="@+id/imageView13" android:layout_width="122dp" android:layout_height="99dp"

android:layout_above="@+id/textView13" android:layout_toLeftOf="@+id/imageView15" android:layout_toStartOf="@+id/imageView15" app:srcCompat="@drawable/logo1"

tools:layout_editor_absoluteX="9dp" tools:layout_editor_absoluteY="170dp" />

<ImageView

android:id="@+id/imageView14" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo2"

tools:layout_editor_absoluteY="170dp" tools:layout_editor_absoluteX="131dp" android:layout_below="@+id/imageView18" android:layout_toRightOf="@+id/imageView15" android:layout_toEndOf="@+id/imageView15" />

<ImageView

android:id="@+id/imageView15" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo3"

tools:layout_editor_absoluteX="253dp" tools:layout_editor_absoluteY="170dp" android:layout_alignTop="@+id/imageView13" android:layout_centerHorizontal="true" />

<ImageView

android:id="@+id/imageView16" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo4" tools:layout_editor_absoluteX="9dp" tools:layout_editor_absoluteY="305dp" android:layout_below="@+id/textView14" android:layout_toRightOf="@+id/textView13" android:layout_toEndOf="@+id/textView13" />

<TextView

android:textColor="#000000" android:id="@+id/textView13"

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

tools:layout_editor_absoluteX="44dp" tools:layout_editor_absoluteY="275dp" android:layout_centerVertical="true"

android:layout_toLeftOf="@+id/imageView15" android:layout_toStartOf="@+id/imageView15" android:layout_marginRight="34dp"

android:layout_marginEnd="34dp" />

(14)

android:id="@+id/imageView17" android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo5"

android:layout_alignTop="@+id/imageView16" android:layout_alignLeft="@+id/imageView13" android:layout_alignStart="@+id/imageView13" />

<ImageView

android:id="@+id/imageView18" android:layout_width="180dp" android:layout_height="150dp" app:srcCompat="@drawable/atas"

android:layout_above="@+id/imageView13" android:layout_centerHorizontal="true" />

<TextView

android:textColor="#000000" android:id="@+id/textView14"

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

android:layout_below="@+id/imageView15" android:layout_centerHorizontal="true" />

<TextView

android:textColor="#000000" android:id="@+id/textView15"

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

android:layout_marginLeft="14dp" android:layout_marginStart="14dp"

android:layout_below="@+id/imageView14" android:layout_toRightOf="@+id/imageView18" android:layout_toEndOf="@+id/imageView18" />

<TextView

android:layout_marginLeft="7dp" android:textColor="#000000" android:id="@+id/textView16"

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

android:layout_below="@+id/imageView17" android:layout_alignLeft="@+id/textView13" android:layout_alignStart="@+id/textView13" />

<TextView

android:textColor="#000000" android:id="@+id/textView17"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/imageView16" android:layout_centerHorizontal="true" android:text="Body Mass Index" />

<ImageView

(15)

android:layout_width="122dp" android:layout_height="99dp" app:srcCompat="@drawable/logo6"

android:layout_below="@+id/textView15" android:layout_toRightOf="@+id/imageView16" android:layout_toEndOf="@+id/imageView16" />

<TextView

android:layout_marginLeft="4dp" android:textColor="#000000" android:id="@+id/textView18"

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

android:layout_below="@+id/imageView19" android:layout_toRightOf="@+id/imageView18" android:layout_toEndOf="@+id/imageView18" />

</RelativeLayout>

Activty_maps.xml

<fragment

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map"

android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent"

android:layout_height="match_parent"

(16)

LocationOpenDb.java

package com.example.xyzskylake.healthcare.ORM.Helper; import android.content.Context;

import android.database.sqlite.SQLiteDatabase; import android.util.Log;

import com.example.xyzskylake.healthcare.ORM.Model.Location; import com.example.xyzskylake.healthcare.R;

import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; import com.j256.ormlite.dao.Dao;

import com.j256.ormlite.dao.GenericRawResults; import com.j256.ormlite.dao.RawRowMapper; import com.j256.ormlite.stmt.QueryBuilder;

import com.j256.ormlite.support.ConnectionSource; import com.j256.ormlite.table.TableUtils;

import java.sql.Date;

import java.sql.SQLException; import java.util.List;

/**

* Created by dolly on 11/19/16. */

public class LocationOpenDb extends OrmLiteSqliteOpenHelper{

private static final String DATABASE_NAME = "map_db";

private static final int DATABASE_VERSION = 1;

/**

* The data access object used to interact with the Sqlite database to do C.R.U.D operations.

*/

private Dao<Location, Long> Location;

public LocationOpenDb(Context context) {

super(context, DATABASE_NAME, null, DATABASE_VERSION, /**

* R.raw.ormlite_config is a reference to the ormlite_config.txt file in the

* /res/raw/ directory of this project * */

R.raw.ormlite_config);

}

@Override

public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {

try { /**

* creates the PairData database table */

TableUtils.createTable(connectionSource,

Location.class);

(17)

} }

@Override

public void onUpgrade(SQLiteDatabase database,

ConnectionSource connectionSource, int oldVersion, int newVersion) {

try { /**

* Recreates the database when onUpgrade is called by the framework

*/

TableUtils.dropTable(connectionSource, Location.class,

false);

onCreate(database, connectionSource);

} catch (SQLException e) { e.printStackTrace(); }

}

/*

* Returns an instance of the data access object * @return

* @throws SQLException */

public Dao<Location, Long> getDao() throws SQLException { if (Location == null) {

Location = getDao(Location.class); }

return Location; }

/**

* Insert PairData *

* @param location */

public void insert(Location location) { try {

getDao().create(location);

Log.i("InsertLocation", location.toString()); } catch (SQLException e) {

e.printStackTrace(); }

}

public List<Location> fetchAll() { List<Location> locations; try {

QueryBuilder qb =

this.getDao().queryBuilder().orderBy("id",true); GenericRawResults<Location> results = this.getDao().queryRaw(

(18)

Location location = new Location( resultColumns[1],

Double.parseDouble(resultColumns[2]),

Double.parseDouble(resultColumns[3]),

resultColumns[4], resultColumns[5]

);

location.setId(Long.parseLong(resultColumns[0]));

location.setCreatedDate(new Date(Long.parseLong(resultColumns[6])));

return location; }

});

locations = results.getResults(); return locations;

} catch (SQLException e) {

// TODO Auto-generated catch block

Log.e("FetchAll", "Error Fetch All");

e.printStackTrace(); return null;

} }

public Location fetch(Long id) { try {

return this.getDao().queryForId(id); } catch (SQLException e) {

// TODO Auto-generated catch block

Log.e("FetchID", Long.toString(id));

e.printStackTrace(); return null;

} }

/**

* Drop current table */

public void drop() { try {

TableUtils.dropTable(getConnectionSource(), Location.class, false);

Log.i("Location", "dropped"); } catch (SQLException e) {

e.printStackTrace(); }

} }

Location.java

package com.example.xyzskylake.healthcare.ORM.Model;

/**

(19)

import com.j256.ormlite.field.DataType; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable;

import java.util.Date;

@DatabaseTable(tableName = "location") public class Location {

@DatabaseField(generatedId=true) private Long id;

@DatabaseField

private String tittle;

@DatabaseField

private double latitude;

@DatabaseField

private double longitude;

@DatabaseField

private String type;

@DatabaseField

private String description;

@DatabaseField(dataType = DataType.DATE_LONG) private Date createdDate;

public Location() {

}

public Location(String tittle, Double latitude, Double longitude, String type, String description) {

this.setTittle(tittle); this.setLatitude(latitude); this.setLongitude(longitude); this.setType(type);

this.setDescription(description); this.setCreatedDate(new Date()); }

public String getTittle() { return tittle;

}

public void setTittle(String tittle) { this.tittle = tittle;

}

public double getLongitude() { return longitude;

}

public void setLongitude(double longitude) { this.longitude = longitude;

(20)

public Long getId() { return id;

}

public void setId(Long id) { this.id = id;

}

public double getLatitude() { return latitude;

}

public void setLatitude(double latitude) { this.latitude = latitude;

}

public String getDescription() { return description;

}

public void setDescription(String description) { this.description = description;

}

public String getType() { return type;

}

public void setType(String type) { this.type = type;

}

public Date getCreatedDate() { return createdDate;

}

public void setCreatedDate(Date createdDate) { this.createdDate = createdDate;

}

@Override

public String toString() { return this.getTittle(); }

}

OrmLiteDbConfig.java

package com.example.xyzskylake.healthcare.ORM.Util;

import com.example.xyzskylake.healthcare.ORM.Model.Location; import com.j256.ormlite.android.apptools.OrmLiteConfigUtil;

import java.io.File;

(21)

/**

* Created by dolly on 11/19/16. */

public class OrmLiteDbConfig extends OrmLiteConfigUtil { /**

* classes represents the models to use for generating the ormlite_config.txt file

*/

private static final Class<?>[] classes = new Class[] {Location.class};

/**

* Given that this is a separate program from the android app, we have to use

* a static main java method to create the configuration file. * @param args

* @throws IOException * @throws SQLException */

public static void main(String[] args) throws IOException, SQLException {

String currentDirectory = "user.dir";

String configPath =

"/app/src/main/res/raw/ormlite_config.txt";

/**

* Gets the project root directory */

String projectRoot = System.getProperty(currentDirectory);

/**

* Full configuration path includes the project root path, and the location

* of the ormlite_config.txt file appended to it */

String fullConfigPath = projectRoot + configPath;

File configFile = new File(fullConfigPath);

/**

* In the a scenario where we run this program serveral times, it will recreate the

* configuration file each time with the updated configurations.

*/

if(configFile.exists()) {

configFile.delete();

configFile = new File(fullConfigPath); }

/**

* writeConfigFile is a util method used to write the necessary configurations

* to the ormlite_config.txt file. */

(22)

} }

Spashscreen.java

package com.example.xyzskylake.healthcare;

import android.app.Activity; import android.content.Intent;

import android.graphics.PixelFormat; import android.os.Bundle;

import android.view.Window;

import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView;

import android.widget.LinearLayout;

public class Splashscreen extends Activity { public void onAttachedToWindow() {

super.onAttachedToWindow(); Window window = getWindow();

window.setFormat(PixelFormat.RGBA_8888); }

/** Called when the activity is first created. */

Thread splashTread; @Override

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

setContentView(R.layout.activity_splashscreen); StartAnimations();

}

private void StartAnimations() {

Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);

anim.reset();

LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay); l.clearAnimation();

l.startAnimation(anim);

anim = AnimationUtils.loadAnimation(this, R.anim.translate);

anim.reset();

ImageView iv = (ImageView) findViewById(R.id.splash); iv.clearAnimation();

iv.startAnimation(anim);

splashTread = new Thread() { @Override

public void run() { try {

int waited = 0;

// Splash screen pause time

while (waited < 3500) {

sleep(100); waited += 100; }

(23)

intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(intent);

Splashscreen.this.finish(); } catch (InterruptedException e) { // do nothing

} finally {

Splashscreen.this.finish(); }

} };

splashTread.start();

}

}

Mainactivty.java

package com.example.xyzskylake.healthcare;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

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

public class MainActivity extends AppCompatActivity {

@Override

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

setContentView(R.layout.activity_main);

View Button = findViewById(R.id.angry_btn);

Button.setOnClickListener(

new Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),tes.class);

startActivity(myIntent); }

} );

}}

tes.java

package com.example.xyzskylake.healthcare;

(24)

import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

import android.view.View;

public class tes extends AppCompatActivity {

@Override

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

setContentView(R.layout.activity_tes);

View hospital = findViewById(R.id.imageView13); View imageView = findViewById(R.id.imageView14); View imageView2 = findViewById(R.id.imageView17); View imageView3 = findViewById(R.id.imageView16); View imageView4 = findViewById(R.id.imageView15); View masuk = findViewById(R.id.imageView18); View imageView5 = findViewById(R.id.imageView19);

imageView.setOnClickListener(

new android.widget.Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),sport.class);

startActivity(myIntent); }

} );

imageView2.setOnClickListener(

new android.widget.Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),activity2.class);

startActivity(myIntent); }

} );

imageView3.setOnClickListener(

new android.widget.Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),berat.class);

startActivity(myIntent); }

} );

imageView4.setOnClickListener(

new android.widget.Button.OnClickListener() {

(25)

Intent myIntent = new Intent(v.getContext(),baby.class);

startActivity(myIntent); }

} );

imageView5.setOnClickListener(

new android.widget.Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),list.class);

startActivity(myIntent); }

} );

masuk.setOnClickListener(new View.OnClickListener() { @Override

public void onClick(View v) { Intent myIntent = new Intent(v.getContext(),Input.class); startActivity(myIntent); }

});

hospital.setOnClickListener(new View.OnClickListener() { @Override

public void onClick(View v) { Intent myIntent = new Intent(v.getContext(),Hospital.class); startActivity(myIntent); }

});

} }

baby.java

package com.example.xyzskylake.healthcare;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

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

public class baby extends AppCompatActivity {

@Override

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

setContentView(R.layout.activity_baby);

(26)
(27)

berat.java

package com.example.xyzskylake.healthcare;

import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

import android.view.View;

import android.widget.EditText; import android.widget.TextView;

public class berat extends AppCompatActivity { private EditText height;

private EditText weight; private TextView result;

@Override

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

setContentView(R.layout.activity_berat);

height = (EditText) findViewById(R.id.height); weight = (EditText) findViewById(R.id.weight); result = (TextView) findViewById(R.id.result); }

public void calculateBMI(View v){

String heightStr = height.getText().toString(); String weightStr = weight.getText().toString();

if (heightStr != null && !"".equals(heightStr)

&& weightStr != null && !"".equals(weightStr)){ float heightvalue = Float.parseFloat(heightStr)/100; float weightvalue = Float.parseFloat((weightStr));

float bmi = weightvalue / (heightvalue * heightvalue);

displayBMI(bmi); }

}

private void displayBMI(float bmi){ String bmilabel = "";

if (Float.compare(bmi, 15f) <= 0 ){ bmilabel =

getString(R.string.very_severely_underweight); }

else if (Float.compare(bmi, 15f)> 0 && Float.compare(bmi, 16f) <= 0 ) {

bmilabel = getString(R.string.severely_underweight);

}

else if (Float.compare(bmi, 16f)> 0 && Float.compare(bmi, 18.5f) <= 0 ) {

bmilabel = getString(R.string.underweight);

}

else if (Float.compare(bmi, 18.5f)> 0 && Float.compare(bmi, 25f) <= 0 ) {

(28)

}

else if (Float.compare(bmi, 25f)> 0 && Float.compare (bmi, 30f)<= 0) {

bmilabel = getString(R.string.overweight);

}

else if (Float.compare(bmi, 30f)> 0 && Float.compare (bmi, 35f)<= 0) {

bmilabel = getString(R.string.obese_class_i);

}

else if (Float.compare(bmi, 35f)> 0 && Float.compare (bmi, 40f)<= 0) {

bmilabel = getString(R.string.obese_class_ii);

}else{

bmilabel = getString(R.string.obese_class_iii); }

bmilabel = bmi + "\n\n" + bmilabel; result.setText(bmilabel);

} }

DirectonJSONParse.java

package com.example.xyzskylake.healthcare;

import com.google.android.gms.maps.model.LatLng;

import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;

import java.util.ArrayList; import java.util.HashMap; import java.util.List;

/**

* Created by anupamchugh on 27/11/15. */

public class DirectionsJSONParser {

/** Receives a JSONObject and returns a list of lists

containing latitude and longitude */

public List<List<HashMap<String,String>>> parse(JSONObject jObject){

List<List<HashMap<String, String>>> routes = new ArrayList<List<HashMap<String,String>>>() ;

JSONArray jRoutes = null; JSONArray jLegs = null; JSONArray jSteps = null;

try {

(29)

/** Traversing all routes */

for(int i=0;i<jRoutes.length();i++){

jLegs =

( (JSONObject)jRoutes.get(i)).getJSONArray("legs");

List path = new ArrayList<HashMap<String, String>>();

/** Traversing all legs */

for(int j=0;j<jLegs.length();j++){

jSteps =

( (JSONObject)jLegs.get(j)).getJSONArray("steps");

/** Traversing all steps */

for(int k=0;k<jSteps.length();k++){

String polyline = ""; polyline =

(String)((JSONObject)((JSONObject)jSteps.get(k)).get("polyline")). get("points");

List list = decodePoly(polyline);

/** Traversing all points */

for(int l=0;l <list.size();l++){

HashMap<String, String> hm = new HashMap<String, String>();

hm.put("lat",

Double.toString(((LatLng)list.get(l)).latitude) ); hm.put("lng",

Double.toString(((LatLng)list.get(l)).longitude) ); path.add(hm);

} }

routes.add(path); }

}

} catch (JSONException e) { e.printStackTrace(); }catch (Exception e){ }

return routes; }

/**

* Method to decode polyline points

* Courtesy : http://jeffreysambells.com/2010/05/27/decoding-polylines-from-google-maps-direction-api-with-java

* */

private List decodePoly(String encoded) {

List poly = new ArrayList();

int index = 0, len = encoded.length(); int lat = 0, lng = 0;

while (index < len) {

int b, shift = 0, result = 0; do {

(30)

result |= (b & 0x1f) << shift; shift += 5;

} while (b >= 0x20);

int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));

lat += dlat;

shift = 0; result = 0; do {

b = encoded.charAt(index++) - 63; result |= (b & 0x1f) << shift; shift += 5;

} while (b >= 0x20);

int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));

lng += dlng;

LatLng p = new LatLng((((double) lat / 1E5)), (((double) lng / 1E5)));

poly.add(p); }

return poly; }

}

sport.java

package com.example.xyzskylake.healthcare;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

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

public class sport extends AppCompatActivity {

@Override

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

setContentView(R.layout.activity_sport); View TextView = findViewById(R.id.textView8); View TextView2 = findViewById(R.id.textView7); View TextView3 = findViewById(R.id.textView9); View TextView4 = findViewById(R.id.textView10);

TextView.setOnClickListener(

new Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),sport1.class);

startActivity(myIntent); }

(31)

TextView2.setOnClickListener(

new Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),sport2.class);

startActivity(myIntent); }

} );

TextView3.setOnClickListener(

new Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),sport3.class);

startActivity(myIntent); }

} );

TextView4.setOnClickListener(

new Button.OnClickListener() {

public void onClick(View v) {

Intent myIntent = new Intent(v.getContext(),sport4.class);

startActivity(myIntent); }

} );

} }

tips.java

package com.example.xyzskylake.healthcare;

import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

import android.webkit.WebView; import android.widget.Button;

public class tips1 extends AppCompatActivity {

@Override

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

setContentView(R.layout.activity_tips1);

(32)

Mapsactivty.java

package com.example.xyzskylake.healthcare;

import android.*;

import android.Manifest;

import android.content.pm.PackageManager; import android.graphics.Color;

import android.location.Location; import android.os.AsyncTask; import android.os.Build;

import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.os.Bundle;

import android.support.v4.content.ContextCompat; import android.util.Log;

import android.widget.Toast;

import

com.example.xyzskylake.healthcare.ORM.Helper.LocationOpenDb; import com.google.android.gms.common.ConnectionResult;

import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap;

import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment;

import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng;

import com.google.android.gms.maps.model.Marker;

import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.PolylineOptions; import com.j256.ormlite.android.apptools.OpenHelperManager;

import org.json.JSONObject;

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream;

import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL;

import java.util.ArrayList; import java.util.HashMap; import java.util.List;

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback,

GoogleApiClient.ConnectionCallbacks,

GoogleApiClient.OnConnectionFailedListener, LocationListener {

private LocationOpenDb locationOpenDbHelper; String tittle_show;

double lat,lng;

(33)

GoogleApiClient mGoogleApiClient; Location mLastLocation;

Marker mCurrLocationMarker;

LocationRequest mLocationRequest;

@Override

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

setContentView(R.layout.activity_maps); this.locationOpenDbHelper =

OpenHelperManager.getHelper(this,LocationOpenDb.class); com.example.xyzskylake.healthcare.ORM.Model.Location location;

final long coor_map =

getIntent().getExtras().getLong("id");

Log.i("Simpan",Long.toString(coor_map));

location = this.locationOpenDbHelper.fetch(coor_map +1);

lat = location.getLatitude(); lng = location.getLongitude(); tittle_show = location.getTittle();

if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

checkLocationPermission(); }

// Obtain the SupportMapFragment and get notified when the map is ready to be used.

SupportMapFragment mapFragment = (SupportMapFragment)

getSupportFragmentManager()

.findFragmentById(R.id.map); mapFragment.getMapAsync(this);

}

/**

* Manipulates the map once available.

* This callback is triggered when the map is ready to be used.

* This is where we can add markers or lines, add listeners or move the camera. In this case,

* we just add a marker near Sydney, Australia.

* If Google Play services is not installed on the device, the user will be prompted to install

* it inside the SupportMapFragment. This method will only be triggered once the user has

* installed Google Play services and returned to the app. */

@Override

public void onMapReady(GoogleMap googleMap) { mMap = googleMap;

// Add a marker in Sydney and move the camera

if (android.os.Build.VERSION.SDK_INT >=

Build.VERSION_CODES.M) {

if (ContextCompat.checkSelfPermission(this,

android.Manifest.permission.ACCESS_FINE_LOCATION)

(34)

buildGoogleApiClient();

mMap.setMyLocationEnabled(true); }

} else {

buildGoogleApiClient();

mMap.setMyLocationEnabled(true); }

}

protected synchronized void buildGoogleApiClient() { mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this)

.addOnConnectionFailedListener(this) .addApi(LocationServices.API)

.build();

mGoogleApiClient.connect(); }

@Override

public void onConnected(@Nullable Bundle bundle) {

mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(1000);

mLocationRequest.setFastestInterval(1000);

mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POW

ER_ACCURACY);

if (ContextCompat.checkSelfPermission(this,

Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {

LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleAp iClient, mLocationRequest, this);

}

}

@Override

public void onConnectionSuspended(int i) {

}

@Override

public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

}

@Override

public void onLocationChanged(Location location) { mLastLocation = location;

if (mCurrLocationMarker != null) { mCurrLocationMarker.remove(); }

//Place current location marker

LatLng latLng = new LatLng(location.getLatitude(),

(35)

MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(latLng);

//markerOptions.title("Current Position");

markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDes criptorFactory.HUE_GREEN));

mCurrLocationMarker = mMap.addMarker(markerOptions); LatLng dest = new LatLng(lat, lng);

markerOptions.position(dest);

markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDes criptorFactory.HUE_ROSE));

mCurrLocationMarker = mMap.addMarker(markerOptions); double temp1 =(location.getLatitude() + 3.566843)/2; double temp2 = (location.getLongitude() + 98.867636)/2; LatLng move = new LatLng(temp1, temp2);

String url = getDirectionsUrl(latLng, dest);

DownloadTask downloadTask = new DownloadTask();

// Start downloading json data from Google Directions API

downloadTask.execute(url);

//move map camera

mMap.moveCamera(CameraUpdateFactory.newLatLng(move));

mMap.animateCamera(CameraUpdateFactory.zoomTo(10));

//stop location updates

if (mGoogleApiClient != null) {

LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApi Client, this);

}

}

public static final int MY_PERMISSIONS_REQUEST_LOCATION = 99; public boolean checkLocationPermission(){

if (ContextCompat.checkSelfPermission(this,

Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

// Asking user if explanation is needed

if

(ActivityCompat.shouldShowRequestPermissionRationale(this,

Manifest.permission.ACCESS_FINE_LOCATION)) {

// Show an explanation to the user *asynchronously* -- don't block

// this thread waiting for the user's response! After the user

// sees the explanation, try again to request the permission.

//Prompt the user once explanation has been shown

ActivityCompat.requestPermissions(this,

(36)

String[]{Manifest.permission.ACCESS_FINE_LOCATION},

MY_PERMISSIONS_REQUEST_LOCATION);

} else {

// No explanation needed, we can request the permission.

ActivityCompat.requestPermissions(this,

new

String[]{Manifest.permission.ACCESS_FINE_LOCATION},

MY_PERMISSIONS_REQUEST_LOCATION); }

return false; } else {

return true; }

}

@Override

public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {

switch (requestCode) {

case MY_PERMISSIONS_REQUEST_LOCATION: {

// If request is cancelled, the result arrays are empty.

if (grantResults.length > 0

&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {

// permission was granted. Do the

// contacts-related task you need to do.

if (ContextCompat.checkSelfPermission(this,

Manifest.permission.ACCESS_FINE_LOCATION)

== PackageManager.PERMISSION_GRANTED) {

if (mGoogleApiClient == null) { buildGoogleApiClient(); }

mMap.setMyLocationEnabled(true); }

} else {

// Permission denied, Disable the functionality that depends on this permission.

Toast.makeText(this, "permission denied",

Toast.LENGTH_LONG).show(); }

return; }

// other 'case' lines to check for other permissions this app might request.

// You can add here other case statements according to your requirement.

(37)

}

private class DownloadTask extends AsyncTask<String, Void, String> {

@Override

protected String doInBackground(String... url) {

String data = "";

try {

data = downloadUrl(url[0]); } catch (Exception e) {

Log.d("Background Task", e.toString()); }

return data; }

@Override

protected void onPostExecute(String result) { super.onPostExecute(result);

ParserTask parserTask = new ParserTask();

parserTask.execute(result);

} }

/**

* A class to parse the Google Places in JSON format */

private class ParserTask extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {

// Parsing the data in non-ui thread

@Override

protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {

JSONObject jObject;

List<List<HashMap<String, String>>> routes = null;

try {

jObject = new JSONObject(jsonData[0]); DirectionsJSONParser parser = new DirectionsJSONParser();

routes = parser.parse(jObject); } catch (Exception e) {

e.printStackTrace(); }

return routes; }

@Override

Referensi

Dokumen terkait

Tujuan penelitian ini adalah Menganalisa hubungan depresi dengan kadar [9] gula darah acak pada penderita Diabetes Mellitus tipe 2 di Ruang Dahlia RSUD Jombang.. Desain penelitian

Tujuan penelitian ini dilakukan adalah untuk menentukan kadar air dan besar bilangan penyabunan dalam minyak kelapa serta menentukan apakah kadar air dan bilangan penyabunan

The main objectives of this study are the (1) measurement and mapping of the spatial distribution of the deformation rates in the study area; (2) analysis of

Sistem penilaian dengan system KPI, selain dapat mengukur kinerja orang per orang, juga bisa dilakukan untuk melakukan pengukuran kinerja secara kelompok, baik itu

Dengan menggunakan Akibat 2.3 ini, dapat dikonstruksi sebuah aljabar graf pada graf- berhingga baris tanpa sources seperti halnya pada graf berarah, dinotasikan dengan

Level 3 ini aktor harus memakan lebih banyak keju dan dihadapkan dengan musuh yang lebih banyak maka dari itu pada level 3 ini pemain harus lebih berhati-hati

informasi manajemen rumah sakit adalah suatu sistem berbasis komputer yang.. menghasilkan sekumpulan informasi yang telah diolah dan saling

Pada tahap pelaksanaan, kegiatan pembelajaran dibagi menjadi tiga bagian yaitu kegiatan awal, kegiatan inti dan kegiatan penutup. Pada kegiatan awal dimulai dengan