Similar documents
Android Programs Day 5

LAMPIRAN PROGRAM. public class Listdata_adiktif extends ArrayAdapter<ModelData_adiktif> {

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2

05. RecyclerView and Styles

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

Tip Calculator. xmlns:tools=" android:layout_width="match_parent"


Intents. Your first app assignment

Lab 6: Google Maps Android API v2 Android Studio 10/14/2016

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation

Android CardView Tutorial

Create Parent Activity and pass its information to Child Activity using Intents.

Basic GUI elements - exercises

M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

MAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

APPENDIX. Application User. MainActivity.java. RegistrationActivity.java

Fragment Example Create the following files and test the application on emulator or device.

Dynamically Create Admob Banner and Interstitial Ads

Data Persistence. Chapter 10

TextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences


Arrays of Buttons. Inside Android

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

android:layout_margintop="5dp" > <EditText android:layout_width="210dp"

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

StoppUhr. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start1"

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

Adapter.

ANDROID PROGRAMS DAY 3

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Fragments. Lecture 11

APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.

M.A.D Assignment # 1

Appendix A : Android Studio Code For Android

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)

Practical 1.ListView example

LAMPIRAN PROGRAM. public class ListArrayAdapterPost extends ArrayAdapter<ModelDataPost> {

Tabel mysql. Kode di PHP. Config.php. Service.php

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop

Android - Widgets Tutorial

Q.1 Explain the dialog and also explain the Demonstrate working dialog in android.

Our First Android Application


@Bind(R.id.input_ ) EditText EditText Button _loginbutton;

Chapter 8 Positioning with Layouts

CITIZEN COP PRESENTED BY :- A CLOUD BASED CRIME REPORT APPLICATION. SOUVIK ROY - IT2014/066 AWSAF AMBAR - IT2014/067 SAYANI DUTTA - IT2014/089

Android - JSON Parser Tutorial

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion

Android Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)

Create a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks.

Android Application Development. By : Shibaji Debnath

Mobile Software Development for Android - I397

1. Simple List. 1.1 Simple List using simple_list_item_1

EMBEDDED SYSTEMS PROGRAMMING Android Services

Database Development In Android Applications

Produced by. Mobile Application Development. Eamonn de Leastar

User Interface Development in Android Applications

BSCS 514- Computer Graphics. Course Supervisor : Dr. Humera Tariq Hands on Lab Sessions: Mr. Faraz Naqvi

API Guide for Gesture Recognition Engine. Version 2.0

Android JSON Parsing Tutorial

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.root.

MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs

Android UI Development

// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.

Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis;

Android Workshop: Model View Controller ( MVC):

COMP61242: Task /04/18

Lecture 14. Android Application Development

ELET4133: Embedded Systems. Topic 15 Sensors

ActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { }

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

Meniu. Create a project:

Action Bar. (c) 2010 Haim Michael. All Rights Reserv ed.

Starting Another Activity Preferences

Open Lecture Mobile Programming. Intro to Material Design

Android Apps Development for Mobile Game Lesson 5

Simple Currency Converter

Android/Java Lightning Tutorial JULY 30, 2018

android-espresso #androidespresso

Android Basics. Android UI Architecture. Android UI 1

Manifest.xml. Activity.java

Vienos veiklos būsena. Theory

API Guide for Gesture Recognition Engine. Version 1.1

Android Layout Types

使用 TensorFlow 設計矩陣乘法計算並轉移執行在 Android 上 建國科技大學資管系 饒瑞佶 2017/8

Hello World. Lesson 1. Android Developer Fundamentals. Android Developer Fundamentals. Layouts, and. NonCommercial

TUTOR FINDER APP REPORT OF MAJOR PROJECT SUBMITTED FOR PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE DEGREE OF MASTERS OF COMPUTER APPLICATION

Serious Gaming. Technical manual. This document is a collection of the code and installation process

Transcription:

LAMPIRAN 1

LAMPIRAN 2 SCREENSHOOT

LAMPIRAN 3 LISTING

FILE JAVA CLASS 1. main_activity.java packagecom.example.sig.sigrs; import android.content.intent; import android.net.uri; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.imagebutton; import android.widget.toast; import com.example.sig.sigrs.controller.profilactivity; public class MainActivity extends AppCompatActivity { Button btn_navigasi; String goolgemap = "com.google.android.apps.maps"; // identitas package aplikasi google masps android Uri gmmintenturi; Intent mapintent; //String masjid_agung_demak = "-6.894649906672214,110.63718136399984"; // koordinat Masjid Agung Demak /*Deklarasi variable*/ protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); ImageButton BtnMap = (ImageButton) findviewbyid(r.id.btnmap); BtnMap.setOnClickListener(new View.OnClickListener() { public void onclick(view v) { Intent intent = new Intent(MainActivity.this, MapsActivity.class); startactivity(intent); ); ImageButton BtnList = (ImageButton) findviewbyid(r.id.btndaftar); BtnList.setOnClickListener(new View.OnClickListener() { public void onclick(view v) { Intent intent = new Intent(MainActivity.this,ProfilActivity.class); startactivity(intent); ); // menyamakan variable pada layout activity_main.xml ImageButton BtnNavigasi = (ImageButton) findviewbyid(r.id.btnnavigasi); BtnNavigasi.setOnClickListener(new View.OnClickListener() { public void onclick(view v) { mapintent = new Intent(Intent.ACTION_VIEW, gmmintenturi); mapintent.setpackage(goolgemap); if (mapintent.resolveactivity(getpackagemanager())!= null) { startactivity(mapintent); else { Toast.makeText(MainActivity.this, "Google Maps Belum Terinstal. Instal Terlebih Dahulu.", Toast.LENGTH_LONG).show(); );

2. maps_activity packagecom.example.sig.sigrs; import android.location.geocoder; import android.support.v4.app.fragmentactivity; import android.os.bundle; import android.view.view; import android.widget.edittext; 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.latlng; import com.google.android.gms.maps.model.markeroptions; import java.io.ioexception; import java.util.list; public class MapsActivityextends FragmentActivity implements OnMapReadyCallback { private GoogleMap mmap; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maps); // 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. */ public void onmapready(googlemap googlemap) { mmap = googlemap; //Sungailiat LatLng Medikastania = new LatLng(-1.875537, 106.115175); mmap.addmarker(new MarkerOptions().position(Medikastania).title("RS. Medika Stania")); mmap.movecamera(cameraupdatefactory.newlatlng(medikastania)); LatLng Soekarno = new LatLng(-2.007774, 106.142479); mmap.addmarker(new MarkerOptions().position(Soekarno).title("RSUP Ir. Soekarno")); mmap.movecamera(cameraupdatefactory.newlatlng(soekarno)); LatLng rsj = new LatLng(-1.900125, 106.110821); mmap.addmarker(new MarkerOptions().position(rsj).title("RSJ Sungailiat")); mmap.movecamera(cameraupdatefactory.newlatlng(rsj)); LatLng rsudsungailiat = new LatLng(-1.88331, 106.139); mmap.addmarker(new MarkerOptions().position(rsudSungailiat).title("RSUD Sungailiat")); mmap.movecamera(cameraupdatefactory.newlatlng(rsudsungailiat));

LatLng Arsani = new LatLng(-1.92137, 106.118); mmap.addmarker(new MarkerOptions().position(Arsani).title("RS Arsani")); mmap.movecamera(cameraupdatefactory.newlatlng(arsani)); //Pangkalpinang LatLng rsbt = new LatLng(-2.23079, 106.135); mmap.addmarker(new MarkerOptions().position(rsbt).title("RS. Bakti Timah")); mmap.movecamera(cameraupdatefactory.newlatlng(rsbt)); LatLng DepatiHamzah = new LatLng(-2.2308, 106.135); mmap.addmarker(new MarkerOptions().position(DepatiHamzah).title("RS. Depati Hamzah")); mmap.movecamera(cameraupdatefactory.newlatlng(depatihamzah)); LatLng Muhaya = new LatLng(-2.112544, 106.112215); mmap.addmarker(new MarkerOptions().position(Muhaya).title("RS. Muhaya")); mmap.movecamera(cameraupdatefactory.newlatlng(muhaya)); LatLng Baktiwara = new LatLng(-2.143689, 106.098083); mmap.addmarker(new MarkerOptions().position(Baktiwara).title("RSK. Bakti Wara")); mmap.movecamera(cameraupdatefactory.newlatlng(baktiwara)); LatLng Intanmedika = new LatLng(-2.138532, 106.115698); mmap.addmarker(new MarkerOptions().position(Intanmedika).title("RS. Intan Medika")); mmap.movecamera(cameraupdatefactory.newlatlng(intanmedika)); LatLng dkt = new LatLng(-2.12541, 106.107126); mmap.addmarker(new MarkerOptions().position(dkt).title("RS. DKT")); mmap.movecamera(cameraupdatefactory.newlatlng(dkt)); LatLng Baznas = new LatLng(-2.108386, 106.123676); mmap.addmarker(new MarkerOptions().position(Baznas).title("Rumah Sehat Baznas")); mmap.movecamera(cameraupdatefactory.newlatlng(baznas)); LatLng Lani = new LatLng(-2.131725, 106.117199); mmap.addmarker(new MarkerOptions().position(Lani).title("RS Bersalin Lani")); mmap.movecamera(cameraupdatefactory.newlatlng(lani)); //Bangka Barat LatLng Sejiransetason = new LatLng(-2.054612, 105.220401); mmap.addmarker(new MarkerOptions().position(Sejiransetason).title("RS. Sejiran Setason")); mmap.movecamera(cameraupdatefactory.newlatlng(sejiransetason)); //Belitung LatLng Almah = new LatLng(-2.86246, 107.939); mmap.addmarker(new MarkerOptions().position(Almah).title("RS. Almah")); mmap.movecamera(cameraupdatefactory.newlatlng(almah)); LatLng Manggar = new LatLng(-2.879631, 108.233876); mmap.addmarker(new MarkerOptions().position(Manggar).title("RSUD Manggar")); mmap.movecamera(cameraupdatefactory.newlatlng(manggar)); LatLng TanjungPandan = new LatLng(-2.671135, 107.68456); mmap.addmarker(new MarkerOptions().position(TanjungPandan).title("RSUD Tanjung Pandan")); mmap.movecamera(cameraupdatefactory.newlatlng(tanjungpandan)); //Bangka Tengah LatLng Koba = new LatLng(-2.512492, 106.413163); mmap.addmarker(new MarkerOptions().position(Koba).title("RSUD Koba")); mmap.movecamera(cameraupdatefactory.newlatlng(koba)); LatLng Siloam = new LatLng(-2.225044, 106.099711); mmap.addmarker(new MarkerOptions().position(Siloam).title("RS. Siloam")); mmap.movecamera(cameraupdatefactory.newlatlng(siloam));

//Bangka Selatan LatLng Toboali = new LatLng(-2.969731, 106.4725); mmap.addmarker(new MarkerOptions().position(Toboali).title("RSUD Toboali")); mmap.movecamera(cameraupdatefactory.newlatlng(toboali)); public void onsearch(view view ) { EditText Location_tf = (EditText) findviewbyid(r.id.tfadress); String location = Location_tf.getText().toString(); List<android.location.Address> addresslist=null; if(location!= null!location.equals("")) { Geocoder geocoder = new Geocoder(this); try { addresslist = geocoder.getfromlocationname(location, 1); catch (IOException e) { e.printstacktrace(); android.location.address address = addresslist.get(0); LatLng latlng = new LatLng(address.getLatitude(), address.getlongitude()); mmap.addmarker(new MarkerOptions().position(latLng).title("Location")); mmap.animatecamera(cameraupdatefactory.newlatlng(latlng)); 3. profil_activity.java packagecom.example.sig.sigrs.controller; import android.app.progressdialog; import android.os.bundle; import android.support.v4.widget.swiperefreshlayout; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.linearlayoutmanager; import android.support.v7.widget.recyclerview; import android.util.log; import android.view.view; import android.widget.textview; import android.widget.toast; import com.example.sig.sigrs.itemadapter; import com.example.sig.sigrs.r; import com.example.sig.sigrs.api.client; import com.example.sig.sigrs.api.service; import com.example.sig.sigrs.model.item; import com.example.sig.sigrs.model.itemresponse; import java.util.list; import retrofit2.call; import retrofit2.callback; import retrofit2.response; public class ProfilActivity extends AppCompatActivity { private RecyclerView recyclerview; TextView Disconnected; private Item item; ProgressDialog pd; private SwipeRefreshLayout swipecontainer;

protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_profil); initviews(); swipecontainer = (SwipeRefreshLayout) findviewbyid(r.id.swipecontainer); swipecontainer.setcolorschemeresources(android.r.color.holo_orange_dark); swipecontainer.setonrefreshlistener(new SwipeRefreshLayout.OnRefreshListener(){ public void onrefresh(){ loadjson(); Toast.makeText(ProfilActivity.this, "Rumah Sakit", Toast.LENGTH_SHORT).show(); ); private void initviews(){ pd = new ProgressDialog(this); pd.setmessage("mengambil Data RS..."); pd.setcancelable(false); pd.show(); recyclerview = (RecyclerView) findviewbyid(r.id.recyclerview); recyclerview.setlayoutmanager(new LinearLayoutManager(getApplicationContext())); recyclerview.smoothscrolltoposition(0); loadjson(); private void loadjson(){ Disconnected = (TextView) findviewbyid(r.id.disconnected); try{ Client client= new Client(); Service apiservice = Client.getClient().create(Service.class); Call<ItemResponse> call = apiservice.getitems(); call.enqueue(new Callback<ItemResponse>() { public void onresponse(call<itemresponse> call, Response<ItemResponse> response) { List<Item> items = response.body().getitems(); recyclerview.setadapter(new ItemAdapter(getApplicationContext(), items)); recyclerview.smoothscrolltoposition(0); swipecontainer.setrefreshing(false); pd.hide(); public void onfailure(call<itemresponse> call, Throwable t) { Log.d("Error", t.getmessage()); Toast.makeText(ProfilActivity.this, "Error Fetching Data!", Toast.LENGTH_SHORT).show(); Disconnected.setVisibility(View.VISIBLE); pd.hide(); ); catch (Exception e){ Log.d("Error", e.getmessage()); Toast.makeText(this, e.tostring(), Toast.LENGTH_SHORT).show();

4. detail_activity.java packagecom.example.sig.sigrs.controller; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.widget.imageview; import android.widget.textview; import com.bumptech.glide.glide; import com.example.sig.sigrs.r; public class DetailActivity extends AppCompatActivity { TextView nama, alamat, profil; ImageView imageview; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_detail); getsupportactionbar().setdisplayhomeasupenabled(true); imageview = (ImageView) findviewbyid(r.id.user_image_header); nama = (TextView) findviewbyid(r.id.headernama); alamat = (TextView) findviewbyid(r.id.alamat); profil = (TextView) findviewbyid(r.id.profilrs); String Nama = getintent().getextras().getstring("nama"); String Alamat = getintent().getextras().getstring("alamat"); String Profil = getintent().getextras().getstring("profil"); String Gambar = getintent().getextras().getstring("gambar"); nama.settext(nama); alamat.settext(alamat); profil.settext(profil); Glide.with(this).load(Gambar).placeholder(R.drawable.load).into(imageView); getsupportactionbar().settitle("details Activity"); /* private Intent creareshareforecastintent(){ String Nama = getintent().getextras().getstring("nama"); String Alamat = getintent().getextras().getstring("alamat"); String Profil = getintent().getextras().getstring("profil"); Intent shareintent = ShareCompat.IntentBuilder.from(this).setType("text/plain") */ public boolean oncreateoptionsmenu(menu menu ){ MenuInflater inflater = getmenuinflater(); inflater.inflate(r.menu.detail, menu); MenuItem menuitem = menu.finditem(r.id.action_share); return true;

5. item_adapter.java packagecom.example.sig.sigrs; import android.content.context; import android.content.intent; import android.support.v7.widget.recyclerview; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import android.widget.textview; import android.widget.toast; import com.example.sig.sigrs.controller.detailactivity; import com.example.sig.sigrs.model.item; import com.squareup.picasso.picasso; import java.util.list; public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ViewHolder> { private List<Item>items; private Context context; public ItemAdapter(Context applicationcontext, List<Item> itemarraylist) { this.context = applicationcontext; this.items = itemarraylist; public ItemAdapter.ViewHolder oncreateviewholder(viewgroup viewgroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.row_user, viewgroup, false); return new ViewHolder(view); public void onbindviewholder(itemadapter.viewholder viewholder, int i) { viewholder.nama.settext(items.get(i).getnama()); viewholder.alamat.settext(items.get(i).getalamat()); viewholder.profil.settext(items.get(i).getprofil()); Picasso.with(context).load(items.get(i).getGambar()).placeholder(R.drawable.load).into(viewHolder.imageView); public int getitemcount() { return items.size(); public class ViewHolder extends RecyclerView.ViewHolder { private TextView nama, Alamat, Profil; private ImageView imageview; public ViewHolder(View view) { super(view); nama = (TextView) view.findviewbyid(r.id.nama); Alamat = (TextView) view.findviewbyid(r.id.alamat); Profil = (TextView) view.findviewbyid(r.id.profil); imageview = (ImageView) view.findviewbyid(r.id.cover); //on item itemview.setonclicklistener(new View.OnClickListener() {

public void onclick(view v) { int pos = getadapterposition(); if (pos!= RecyclerView.NO_POSITION) { Item clickeddataitem = items.get(pos); Intent intent = new Intent(context, DetailActivity.class); intent.putextra("nama", items.get(pos).getnama()); intent.putextra("alamat", items.get(pos).getalamat()); intent.putextra("profil", items.get(pos).getprofil()); intent.putextra("gambar", items.get(pos).getgambar()); intent.addflags(intent.flag_activity_new_task); context.startactivity(intent); Toast.makeText(v.getContext(), "Kamu Memilih" + clickeddataitem.getnama(), Toast.LENGTH_SHORT).show(); ); 6. item_response.java packagecom.example.sig.sigrs.model; import com.google.gson.annotations.expose; import com.google.gson.annotations.serializedname; import java.util.list; /** * Created by destyyani on 7/11/17. */ public class ItemResponse { @SerializedName("items") @Expose private List<Item>items; public List<Item> getitems(){ return items; public void setitems(list<item>items){ this.items = items; 7. item.java packagecom.example.sig.sigrs.model; import com.google.gson.annotations.expose; import com.google.gson.annotations.serializedname; /** * Created by destyyani on 7/11/17. */ public class Item { @SerializedName("Nama") @Expose private String Nama; @SerializedName("Alamat") @Expose private String Alamat; @SerializedName("Profil") @Expose private String Profil;

@SerializedName("Gambar") @Expose private String Gambar; public Item(String Nama, String Alamat, String Profil, String Gambar){ this.nama = Nama; this.alamat = Alamat; this.profil = Profil; this.gambar = Gambar; public String getnama(){ return Nama; public void setnama(string Nama){ this.nama = Nama; public String getalamat(){ return Alamat; public void setalamat(string Alamat){ this.alamat = Alamat; public String getprofil(){ return Profil; public void setprofil(string Profil){ this.profil = Profil; public String getgambar(){ return Gambar; public void setgambar(string Gambar){ this.gambar = Gambar; 8. service.java packagecom.example.sig.sigrs.api; import com.example.sig.sigrs.model.itemresponse; import retrofit2.call; import retrofit2.http.get; /** * Created by destyyani on 7/11/17. */ public interface Service { @GET("/getdata.php?Kode_RS") Call<ItemResponse> getitems();

9. client.java packagecom.example.sig.sigrs.api; import retrofit2.retrofit; import retrofit2.converter.gson.gsonconverterfactory; /** * Created by destyyani on 7/11/17. */ public class Client { public static final String BASE_URL = "https://sigrs.000webhostapp.com"; public static Retrofit retrofit = null; public static Retrofit getclient(){ if (retrofit==null){ retrofit = new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build(); return retrofit;

FILE.XML 1. Activity_main.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" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.example.sig.sigrs.mainactivity" android:background="#ffffff" android:contextclickable="false"> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btndaftar" android:src="@drawable/list" android:baselinealignbottom="true" android:adjustviewbounds="true" android:background="#ffffff" android:layout_above="@+id/btnmap" android:layout_centerhorizontal="true" android:layout_marginbottom="35dp" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btnmap" android:src="@drawable/map" android:croptopadding="true" android:background="#ffffff" android:layout_centervertical="true" android:layout_centerhorizontal="true" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btnnavigasi" android:src="@drawable/navigasi" android:croptopadding="true" android:background="#ffffff" android:layout_below="@+id/btnmap" android:layout_alignleft="@+id/btndaftar" android:layout_alignstart="@+id/btndaftar" /> </RelativeLayout> 2. Activity_maps.xml <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="wrap_content"

android:layout_height="wrap_content"> <EditText android:layout_width="450dp" android:layout_height="wrap_content" android:id="@+id/tfadress" /> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="search" android:id="@+id/bsearch" android:layout_gravity="right" android:onclick="onsearch" /> </LinearLayout> <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="wrap_content" android:layout_height="wrap_content" tools:context="com.example.sig.sigrs.mapsactivity" tools:layout="@layout/abc_action_bar_title_item"/> </LinearLayout> 3. Activity Profil.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.swiperefreshlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/swipecontainer"> <android.support.v7.widget.recyclerview android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent" tools:showin="@layout/activity_profil" android:backgroundtint="#f2f2f2" tools:context=".controller.profilactivity"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/disconnected" android:text="@string/internet" android:textstyle="bold" android:textsize="14sp"/> </android.support.v4.widget.swiperefreshlayout> 4. Activity_Detail.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"> <ImageView

android:layout_width="match_parent" android:layout_height="250dp" android:id="@+id/user_image_header" android:fitssystemwindows="true" android:scaletype="fitxy"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/headernama" android:layout_marginleft="10dp" android:textalignment="center" android:layout_margintop="10dp" android:textstyle="bold" android:textsize="20dp" android:layout_below="@+id/user_image_header"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/alamat" android:layout_marginleft="10dp" android:textsize="14dp" android:textalignment="center" android:layout_margintop="10dp" android:layout_below="@+id/headernama"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/profilrs" android:layout_marginleft="10dp" android:textsize="14dp" android:textalignment="center" android:layout_margintop="20dp" android:layout_below="@+id/alamat"/> </RelativeLayout> 5. Row_user.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="150dp" android:layout_margintop="10dp" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:clickable="true" android:focusable="true" android:elevation="60dp" android:foreground="?android:attr/selectableitembackground"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="100dp" android:layout_height="100dp" android:id="@+id/cover" android:layout_marginleft="20dp" android:layout_margintop="10dp" android:scaletype="fitxy"/>

<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="rumah Sakit" android:id="@+id/nama" android:layout_torightof="@+id/cover" android:layout_marginleft="20dp" android:layout_margintop="5dp" android:textappearance="?android:textappearancemedium" android:textstyle="bold"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="alamat" android:id="@+id/alamat" android:layout_torightof="@+id/cover" android:layout_marginleft="20dp" android:layout_margintop="5dp" android:layout_below="@+id/nama" android:textappearance="?android:textappearancesmall" android:textstyle="italic"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="profil" android:id="@+id/profil" android:layout_torightof="@+id/cover" android:layout_marginleft="20dp" android:layout_margintop="5dp" android:layout_below="@+id/alamat" android:textsize="12dp" android:textstyle="normal"/> </RelativeLayout> </android.support.v7.widget.cardview>