10 Lampiran B Kode Program APK - LAMPIRAN B KODE PROGRAM...

This preview shows page 1 - 3 out of 11 pages.

LAMPIRAN B KODE PROGRAM JAVA APLIKASI TELEMETRI PADA PONSEL ANDROID Kode program D.1 Kelas MainActivity.java package com.skripsi.telemetrilogger; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.Toast; //Kelas untuk aktivitas utama aplikasi telemetri public class MainActivity extends Activity { static public final String ARG_TEXT_ID = "text_id"; @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout. activity_main );} // Button untuk memanggil aktivitas Tampilan Tabel public void tabelView(View view) { Intent i = new Intent(); i.setAction("net.telemetrilogger.TampilanTabel"); startActivity(i);} // Button untuk memanggil aktivitas Tampilan Grafik public void grafikView(View view) { Intent i = new Intent(); i.setAction("net.telemetrilogger.TampilanGrafik"); startActivity(i); // Button untuk memanggil aktivitas Atur Waktu Sampling public void setSampling(View view) { Intent i = new Intent(); i.setAction("net.telemetrilogger.SetSampling"); startActivity(i);} // Button untuk memanggil aktivitas Bantuan public void Bantuan(View view) { int textId = -1; textId = R.string. topic_section1 ; if (textId >= 0) startInfoActivity (textId); else toast ("Detailed Help for that topic is not available.", true );} public void startInfoActivity ( int textId){ if (textId >= 0) { Intent intent = ( new Intent( this , Bantuan. class )); intent.putExtra ( ARG_TEXT_ID , textId); startActivity (intent);} else {toast ("No information is available for topic: " + textId, true );}} // end startInfoActivity public void toast (String msg, boolean longLength){ Toast. makeText (getApplicationContext(), msg, (longLength ? Toast. LENGTH_LONG : Toast. LENGTH_SHORT )).show ();}} B - 1
Image of page 1

Subscribe to view the full document.

B - 2 Kode program D.2 Kelas PenampilTabel.java package com.skripsi.telemetrilogger; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.os.Environment; import android.telephony.SmsManager; import android.telephony.SmsMessage; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Spinner; import android.widget.Toast; //Kelas untuk aktivitas penamplil data suhu dan RH ke tabel public class PenampilTabel extends Activity implements OnClickListener { String cycleTime; String noTujuan = "+6289665843560"; PendingIntent sentPI, deliveredPI; BroadcastReceiver smsSentReceiver, smsDeliveredReceiver; String SENT = "SMS_SENT"; String DELIVERED = "SMS_DELIVERED"; Spinner pilihan; Object value; public static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
Image of page 2
Image of page 3
  • Spring '16
  • Antin
  • Void type, null character, Empty string, Spinner pilihan

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern