package com.netfluke.sergey.purringservice; import android.content.Intent; import android.os.Build; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Get the device's serial number // https://stackoverflow.com/questions/11029294/android-how-to-programmatically-access-the-device-serial-number-shown-in-the-av // https://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id // https://stackoverflow.com/questions/13744565/android-device-id-confusion/13831099#13831099 Log.i("TAG","android.os.Build.SERIAL: " + Build.SERIAL); } public void startService(View view) { startService(new Intent(this, MyService.class)); } public void stopService(View view) { stopService(new Intent(this, MyService.class)); } }