Click here to load reader
Upload
minh-hoang
View
235
Download
0
Embed Size (px)
Citation preview
Embedded Server for Android
To Minh Hoang
September 14, 2015
Agenda
Problem
Solution
Demo
ProblemSolution
DemoQ&A
SSHDroid
3 / 11
ProblemSolution
DemoQ&A
Problem
Agent running on one device receives requestsand returns responses to other devicesfollowing a set of rules
4 / 11
ProblemSolution
DemoQ&A
Component Architecture
Service runs on its own threads.
Service Lifecycle Manager adapted to Android Component Lifecycle.
Service Resource Manager bridged to Android Resource Manager.
5 / 11
ProblemSolution
DemoQ&A
Sample Code
HttpServer Sample:
new HttpServer.Builder().port(8080).worker(Executors.newFixedThreadPool(5)).build().start();
Starting Service Sample:
startButton.setOnClickListener(...public void onClick(View v){//Post code starting service to non-UI thread}...);
Resource Manager Sample:
public class VirtualFS{//Entry to Android device resourcesprivate final Context ctx;//File handling methods}
6 / 11
ProblemSolution
DemoQ&A
Netty Framework
Best event-driven networking framework in Java
Eligible to use in Android (Netty 3.x)
Protocol-independent core design
Out-of-the-box support for common protocols
7 / 11
ProblemSolution
DemoQ&A
Netty Pipeline
8 / 11
ProblemSolution
DemoQ&A
Netty-based Service
9 / 11
ProblemSolution
DemoQ&A
Demo
10 / 11
ProblemSolution
DemoQ&A
11 / 11