lwc:programming:mobile:android:threads

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lwc:programming:mobile:android:threads [2022/01/17 16:21] – created John Harrisonlwc:programming:mobile:android:threads [2022/05/11 19:03] (current) John Harrison
Line 1: Line 1:
-A hodge-podge of tips, snippets, etc. in my journey to figure out the Android thread thing.+//A hodge-podge of tips, snippets, etc. in my journey to figure out the Android thread thing.//
  
 ==== Run a routine every second ==== ==== Run a routine every second ====
 === With Handler === === With Handler ===
-//I assume since this is with ''Handler'' and ''Runnable'' that this is in a separate thread? How to confirm?// 
 <code> <code>
 final Handler handler = new Handler(); final Handler handler = new Handler();
Line 16: Line 15:
 </code> </code>
 === With Timer === === With Timer ===
-//Does this run in separate thread?// 
 <code> <code>
 new Timer().scheduleAtFixedRate(new TimerTask() { new Timer().scheduleAtFixedRate(new TimerTask() {
Line 26: Line 24:
 </code> </code>
  
 +==== Classes and Interfaces ====
 +Creating an anonymous class:
 +  * Do you have to have an Interface to create the class because it seems to look like this:
 +<code>
 +InterfaceName instanceName InterfaceName() {
 +  // put your loved ones here;
 +}
 +</code>
 +
 +An interface wouldn't take a parameter. If your class needs parameters you'd have a method with the same name as the interface that takes the parameters? I see how this works with classes but not sure with Interfaces
 +
 +===== References =====
 +  * [[https://guides.codepath.com/android/managing-threads-and-custom-services|Excellent guide to Services]]
  
 +===== Not Completely Digested =====
 +  * [[https://developer.android.com/guide/components/services#java|Official documentation of services in Android]]
 +  * [[https://guides.codepath.com/android/Starting-Background-Services|Codepath guide to background services]]
 +  * [[https://developer.android.com/guide/components/processes-and-threads|Official documentation to processes and Threads]]
  • lwc/programming/mobile/android/threads.1642458078.txt.gz
  • Last modified: 2022/01/17 16:21
  • by John Harrison