github.com/shranet/mobile@v0.0.0-20200814083559-5702cdcd481b/app/MyService.java (about) 1 package org.golang.app; 2 3 import android.app.Notification; 4 import android.app.PendingIntent; 5 import android.app.Service ; 6 import android.content.Intent; 7 import android.os.IBinder; 8 import android.util.Log; 9 import java.net.Socket; 10 import android.os.SystemClock; 11 import java.lang.Thread; 12 13 public class MyService extends Service { 14 // static { 15 // System.loadLibrary("abu-saxiy"); 16 // } 17 18 private native void printText(); 19 20 @Override 21 public IBinder onBind(Intent intent) { 22 Log.d("Go", "MyService onBind"); 23 return null; 24 } 25 26 public int onStartCommand(Intent intent, int flags, int startId) { 27 Log.d("Go", "MyService onStartCommand"); 28 29 return super.onStartCommand(intent, flags, startId); 30 } 31 32 public void onStart() { 33 Log.d("Go", "MyService onStart"); 34 } 35 36 public void onDestroy() { 37 Log.d("Go", "MyService onDestroy"); 38 super.onDestroy(); 39 } 40 41 @Override 42 public void onCreate() { 43 Log.d("Go", "MyService onCreate"); 44 super.onCreate(); 45 46 Log.d("Go", "MyService before call"); 47 printText(); 48 Log.d("Go", "MyService after call"); 49 } 50 }