Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1002649 // Android: Try to start PermanentService

JavaX source code (Android) [tags: use-pretranspiled] - run with: the app

Libraryless. Click here for Pure Java version (272L/2K/8K).

!752

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

p {
  Class serviceClass = Class.forName("de.tinybrain.javax_allperms.PermanentService");
  print("serviceClass: " + serviceClass);
  if (serviceClass == null) ret;
  
  // use this to start and trigger a service
  
  Activity context = getAndroidContext();
  print("Context: " + context);
  
  Intent i = new Intent(context, serviceClass);
  context.startService(i); 
  
  print("Service started?");

  print("Instance: " + get(serviceClass, "instance"));
  
  sleepSeconds(5);
  
  print("Instance: " + get(serviceClass, "instance"));
}

Author comment

Began life as a copy of #1002648

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, nbgitpuheiab, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002649
Snippet name: Android: Try to start PermanentService
Eternal ID of this version: #1002649/1
Text MD5: 639a8f2236498aa571ed4de2499baa03
Transpilation MD5: 5c7dd383c756b3293777e8eadee378ca
Author: stefan
Category: javax
Type: JavaX source code (Android)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-09 21:38:43
Source code size: 640 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 545 / 573
Referenced in: [show references]