SlideShare a Scribd company logo
(Live) Build and run
Golang Web server on
Android.avi
SeongJae Park <sj38.park@gmail.com>
Nice To Meet You
SeongJae Park
sj38.park@gmail.com
golang newbie programmer
Disclaimer
The main part of session is live-coding. This
slide has only little information.
Inspired by camlistore and outyet
Maybe useless, *just for fun*
Goal Of This Session
Build and run Golang web server on Android
Live Coding
golang: Programming Language
for simple, reliable, and efficient software.
http://blog.golang.org/5years/gophers5th.jpg
Web server
Processes request via HTTP protocol
Web Server Client
Web server
Processes request via HTTP protocol
Listen a socket
Receive HTTP request from the socket
Web Server Client
url: /blahblah,
method: GET
Web server
Processes request via HTTP protocol
Listen a socket
Receive HTTP request from the socket
Process the request
Web Server Client
url: /blahblah,
method: GET
Web server
Processes request via HTTP protocol
Listen a socket
Receive HTTP request from the socket
Process the request
Send HTTP response to client using the socket
Web Server Client
url: /blahblah,
method: GET
Status: OK,
Body: <p>welcome</p>
(Live) Simple Golang Webserver
…...
(Live) Simple Golang Webserver
…... complete
net/http rules
The code: https://github.
com/sjp38/linuxOutYet/tree/804aa370f5adbf3d
4377ee1b1e862cbc49d81c1c
Golang and Android
● Golang Supports Android officially from v1.4
○ The support focus on Application; just let .so or .apk
https://blog.golang.org/gopher/gopher.png
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png
Golang and Android
● Golang Supports Android officially from v1.4
○ The support focus on Application; just let .so or .apk
○ Requires complex build process and client code
https://blog.golang.org/gopher/gopher.png
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png
Golang and Android
● Golang Supports Android officially from v1.4
○ The support focus on Application; just let .so or .apk
○ Requires complex build process and client code
○ Couldn’t be more simple, easier?
https://blog.golang.org/gopher/gopher.png
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png
Golang on Android: Background
Android is a variant of Linux system with ARM
x86 Android exist, though...
http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
Golang on Android: Background
Android is a variant of Linux system with ARM
x86 Android exist, though...
Go supports ARM & Linux Officially
with static-linking
http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
Golang on Android: Background
Android is a variant of Linux system with ARM
x86 Android exist, though...
Go supports ARM & Linux Officially
with static-linking
So, why not?
http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
Golang on Android: Plan
1. Cross compile Go program as ARM / Linux
Golang on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
Golang on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
3. Copy the binary in private space of the app
Golang on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
3. Copy the binary in private space of the app
4. Give execute permission to the binary
/data/data/com.example.goRunner/files # ls -al
-rwxrwxrwx u0_a55 u0_a55 4512840 2014-11-28 17:45 gobin
Golang on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
3. Copy the binary in private space of the app
4. Give execute permission to the binary
5. Execute it
/data/data/com.example.goRunner/files # ls -al
-rwxrwxrwx u0_a55 u0_a55 4512840 2014-11-28 17:45 gobin
(Live) Golang on Android
……
(Live) Golang on Android: Problem
…… Not successful
go binary runner code:
https://github.
com/sjp38/goOnAndroidFA/releases/tag/devfair
2014.gdg.kr
(Live) Golang on Android: Problem
…… Not successful
It has no /etc/hosts
CA Certs path is different with pure Linux
/system/etc/security/cacerts
(Live) Golang on Android: Problem
…… Not successful
It has no /etc/hosts
CA Certs path is different with pure Linux
/system/etc/security/cacerts
Android is a variant of, not pure Linux
GOOS=android has same problem, too :’(
(Live) Golang on Android: Solution
It has no /etc/hosts
Get IP manually
Certifications path is different
Use those certifications
(Live) Golang on Android: Again
……
(Live) Golang on Android
…… Complete
It’s hacky, but works
The code: https://github.
com/sjp38/linuxOutYet/releases/tag/devfair201
4.gdg.kr
Summary
Golang program can run on Android
Summary
Golang program can run on Android
Officially as .so or .apk file
Summary
Golang program can run on Android
Officially as .so or .apk file
Or, as elf binary with unofficial, little hack
Summary
Golang program can run on Android
Officially as .so or .apk file
Or, as elf binary with unofficial, little hack
Some features don’t work on Android, yet
Still need some hacks
Final Source Code
go web server: https://github.
com/sjp38/linuxOutYet/releases/tag/devfair201
4.gdg.kr
go program runner(Android app): https://github.
com/sjp38/goOnAndroidFA/releases/tag/devfair
2014.gdg.kr
This slide has been used for
GDG Korea DevFair 2014
GDG Korea Golang Seoul Meetup
This work by SeongJae Park is licensed under the
Creative Commons Attribution-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http:
//creativecommons.org/licenses/by-sa/3.0/.

More Related Content

What's hot

COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Evan Lin
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
inovex GmbH
 
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn [INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
Nexus FrontierTech
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
Spandana Govindgari
 
Introduction to Gitea with Drone
Introduction to Gitea with DroneIntroduction to Gitea with Drone
Introduction to Gitea with Drone
Bo-Yi Wu
 
All a flutter about Flutter.io
All a flutter about Flutter.ioAll a flutter about Flutter.io
All a flutter about Flutter.io
Steven Cooper
 
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
Ranatchai Chernbamrung
 
Jedi knight
Jedi knightJedi knight
Jedi knight
Antonio Mas
 
Spring-batch Groovy y Gradle
Spring-batch Groovy y GradleSpring-batch Groovy y Gradle
Spring-batch Groovy y Gradle
Antonio Mas
 
Study Jam Session 2
Study Jam Session 2Study Jam Session 2
Study Jam Session 2
Boston Android
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
Bo-Yi Wu
 
Study Jam: Android for Beginners, Summary
Study Jam: Android for Beginners, SummaryStudy Jam: Android for Beginners, Summary
Study Jam: Android for Beginners, Summary
Constantine Mars
 
Golang Microservices meetup
Golang Microservices meetupGolang Microservices meetup
Golang Microservices meetup
Girish Ramnani
 
Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot
Evan Lin
 
React native first impression
React native first impressionReact native first impression
React native first impression
Alvaro Viebrantz
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
 
Fastlane on Android 介紹
Fastlane on Android 介紹Fastlane on Android 介紹
Fastlane on Android 介紹
Kros Huang
 
Tips for better CI on Android
Tips for better CI on AndroidTips for better CI on Android
Tips for better CI on Android
Tomoaki Imai
 
Desarrollo multiplataforma con kotlin | UPV 2018
Desarrollo multiplataforma con kotlin  | UPV 2018Desarrollo multiplataforma con kotlin  | UPV 2018
Desarrollo multiplataforma con kotlin | UPV 2018
Víctor Bolinches
 
Cross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React NativeCross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React Native
Korhan Bircan
 

What's hot (20)

COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
 
Moderne Android Builds mit Gradle
Moderne Android Builds mit GradleModerne Android Builds mit Gradle
Moderne Android Builds mit Gradle
 
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn [INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Introduction to Gitea with Drone
Introduction to Gitea with DroneIntroduction to Gitea with Drone
Introduction to Gitea with Drone
 
All a flutter about Flutter.io
All a flutter about Flutter.ioAll a flutter about Flutter.io
All a flutter about Flutter.io
 
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
 
Jedi knight
Jedi knightJedi knight
Jedi knight
 
Spring-batch Groovy y Gradle
Spring-batch Groovy y GradleSpring-batch Groovy y Gradle
Spring-batch Groovy y Gradle
 
Study Jam Session 2
Study Jam Session 2Study Jam Session 2
Study Jam Session 2
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 
Study Jam: Android for Beginners, Summary
Study Jam: Android for Beginners, SummaryStudy Jam: Android for Beginners, Summary
Study Jam: Android for Beginners, Summary
 
Golang Microservices meetup
Golang Microservices meetupGolang Microservices meetup
Golang Microservices meetup
 
Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot
 
React native first impression
React native first impressionReact native first impression
React native first impression
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Fastlane on Android 介紹
Fastlane on Android 介紹Fastlane on Android 介紹
Fastlane on Android 介紹
 
Tips for better CI on Android
Tips for better CI on AndroidTips for better CI on Android
Tips for better CI on Android
 
Desarrollo multiplataforma con kotlin | UPV 2018
Desarrollo multiplataforma con kotlin  | UPV 2018Desarrollo multiplataforma con kotlin  | UPV 2018
Desarrollo multiplataforma con kotlin | UPV 2018
 
Cross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React NativeCross-Platform App Development with Flutter, Xamarin, React Native
Cross-Platform App Development with Flutter, Xamarin, React Native
 

Viewers also liked

Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and GomobileGo goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Takahiro Yoshimura
 
Git inter-snapshot public
Git  inter-snapshot publicGit  inter-snapshot public
Git inter-snapshot public
SeongJae Park
 
gcma: guaranteed contiguous memory allocator
gcma:  guaranteed contiguous memory allocatorgcma:  guaranteed contiguous memory allocator
gcma: guaranteed contiguous memory allocator
SeongJae Park
 
Deep dark side of git - prologue
Deep dark side of git - prologueDeep dark side of git - prologue
Deep dark side of git - prologueSeongJae Park
 
Sw install with_without_docker
Sw install with_without_dockerSw install with_without_docker
Sw install with_without_docker
SeongJae Park
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory model
SeongJae Park
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
SeongJae Park
 

Viewers also liked (7)

Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and GomobileGo goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
 
Git inter-snapshot public
Git  inter-snapshot publicGit  inter-snapshot public
Git inter-snapshot public
 
gcma: guaranteed contiguous memory allocator
gcma:  guaranteed contiguous memory allocatorgcma:  guaranteed contiguous memory allocator
gcma: guaranteed contiguous memory allocator
 
Deep dark side of git - prologue
Deep dark side of git - prologueDeep dark side of git - prologue
Deep dark side of git - prologue
 
Sw install with_without_docker
Sw install with_without_dockerSw install with_without_docker
Sw install with_without_docker
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory model
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
 

Similar to (Live) build and run golang web server on android.avi

Go for Mobile Games
Go for Mobile GamesGo for Mobile Games
Go for Mobile Games
Takuya Ueda
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
natdefreitas
 
NodeWay in my project & sails.js
NodeWay in my project & sails.jsNodeWay in my project & sails.js
NodeWay in my project & sails.jsDmytro Ovcharenko
 
Pwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreakPwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreak
Abraham Aranguren
 
Mobile Apps by Pure Go with Reverse Binding
Mobile Apps by Pure Go with Reverse BindingMobile Apps by Pure Go with Reverse Binding
Mobile Apps by Pure Go with Reverse Binding
Takuya Ueda
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
Justin James
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
Web applications support on AGL
Web applications support on AGLWeb applications support on AGL
Web applications support on AGL
Igalia
 
Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?
GlobalLogic Ukraine
 
Head first android apps dev tools
Head first android apps dev toolsHead first android apps dev tools
Head first android apps dev tools
Shaka Huang
 
[Gstar 2013] Unity Security
[Gstar 2013] Unity Security[Gstar 2013] Unity Security
[Gstar 2013] Unity Security
Seungmin Shin
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc project
Alexandre Gouaillard
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Webrtc plugins for Desktop Browsers
Webrtc plugins for Desktop BrowsersWebrtc plugins for Desktop Browsers
Webrtc plugins for Desktop Browsers
Alexandre Gouaillard
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
Opersys inc.
 
Android
Android Android
Android
Ravina Bhavsar
 
Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015
Licel
 
Google Chronicles: Analytics And Chrome
Google Chronicles: Analytics And ChromeGoogle Chronicles: Analytics And Chrome
Google Chronicles: Analytics And Chrome
Sarah Dutkiewicz
 
GDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android NGDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android N
Imam Raza
 

Similar to (Live) build and run golang web server on android.avi (20)

Go for Mobile Games
Go for Mobile GamesGo for Mobile Games
Go for Mobile Games
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
NodeWay in my project & sails.js
NodeWay in my project & sails.jsNodeWay in my project & sails.js
NodeWay in my project & sails.js
 
Pwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreakPwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreak
 
Mobile Apps by Pure Go with Reverse Binding
Mobile Apps by Pure Go with Reverse BindingMobile Apps by Pure Go with Reverse Binding
Mobile Apps by Pure Go with Reverse Binding
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
Web applications support on AGL
Web applications support on AGLWeb applications support on AGL
Web applications support on AGL
 
Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?
 
Head first android apps dev tools
Head first android apps dev toolsHead first android apps dev tools
Head first android apps dev tools
 
[Gstar 2013] Unity Security
[Gstar 2013] Unity Security[Gstar 2013] Unity Security
[Gstar 2013] Unity Security
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc project
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Webrtc plugins for Desktop Browsers
Webrtc plugins for Desktop BrowsersWebrtc plugins for Desktop Browsers
Webrtc plugins for Desktop Browsers
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android
Android Android
Android
 
Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015
 
Google Chronicles: Analytics And Chrome
Google Chronicles: Analytics And ChromeGoogle Chronicles: Analytics And Chrome
Google Chronicles: Analytics And Chrome
 
GDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android NGDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android N
 

More from SeongJae Park

Biscuit: an operating system written in go
Biscuit:  an operating system written in goBiscuit:  an operating system written in go
Biscuit: an operating system written in go
SeongJae Park
 
GCMA: Guaranteed Contiguous Memory Allocator
GCMA: Guaranteed Contiguous Memory AllocatorGCMA: Guaranteed Contiguous Memory Allocator
GCMA: Guaranteed Contiguous Memory Allocator
SeongJae Park
 
Linux Kernel Memory Model
Linux Kernel Memory ModelLinux Kernel Memory Model
Linux Kernel Memory Model
SeongJae Park
 
An Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux KernelAn Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux Kernel
SeongJae Park
 
Design choices of golang for high scalability
Design choices of golang for high scalabilityDesign choices of golang for high scalability
Design choices of golang for high scalability
SeongJae Park
 
Brief introduction to kselftest
Brief introduction to kselftestBrief introduction to kselftest
Brief introduction to kselftest
SeongJae Park
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
SeongJae Park
 
Experimental android hacking using reflection
Experimental android hacking using reflectionExperimental android hacking using reflection
Experimental android hacking using reflection
SeongJae Park
 
ash
ashash
Hacktime for adk
Hacktime for adkHacktime for adk
Hacktime for adk
SeongJae Park
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
SeongJae Park
 
Touch Android Without Touching
Touch Android Without TouchingTouch Android Without Touching
Touch Android Without Touching
SeongJae Park
 
AOSP에 컨트리뷰션 하기 dev festx korea 2012 presentation
AOSP에 컨트리뷰션 하기   dev festx korea 2012 presentationAOSP에 컨트리뷰션 하기   dev festx korea 2012 presentation
AOSP에 컨트리뷰션 하기 dev festx korea 2012 presentation
SeongJae Park
 

More from SeongJae Park (13)

Biscuit: an operating system written in go
Biscuit:  an operating system written in goBiscuit:  an operating system written in go
Biscuit: an operating system written in go
 
GCMA: Guaranteed Contiguous Memory Allocator
GCMA: Guaranteed Contiguous Memory AllocatorGCMA: Guaranteed Contiguous Memory Allocator
GCMA: Guaranteed Contiguous Memory Allocator
 
Linux Kernel Memory Model
Linux Kernel Memory ModelLinux Kernel Memory Model
Linux Kernel Memory Model
 
An Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux KernelAn Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux Kernel
 
Design choices of golang for high scalability
Design choices of golang for high scalabilityDesign choices of golang for high scalability
Design choices of golang for high scalability
 
Brief introduction to kselftest
Brief introduction to kselftestBrief introduction to kselftest
Brief introduction to kselftest
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
 
Experimental android hacking using reflection
Experimental android hacking using reflectionExperimental android hacking using reflection
Experimental android hacking using reflection
 
ash
ashash
ash
 
Hacktime for adk
Hacktime for adkHacktime for adk
Hacktime for adk
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
 
Touch Android Without Touching
Touch Android Without TouchingTouch Android Without Touching
Touch Android Without Touching
 
AOSP에 컨트리뷰션 하기 dev festx korea 2012 presentation
AOSP에 컨트리뷰션 하기   dev festx korea 2012 presentationAOSP에 컨트리뷰션 하기   dev festx korea 2012 presentation
AOSP에 컨트리뷰션 하기 dev festx korea 2012 presentation
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

(Live) build and run golang web server on android.avi

  • 1. (Live) Build and run Golang Web server on Android.avi SeongJae Park <sj38.park@gmail.com>
  • 2. Nice To Meet You SeongJae Park sj38.park@gmail.com golang newbie programmer
  • 3. Disclaimer The main part of session is live-coding. This slide has only little information. Inspired by camlistore and outyet Maybe useless, *just for fun*
  • 4. Goal Of This Session Build and run Golang web server on Android Live Coding
  • 5. golang: Programming Language for simple, reliable, and efficient software. http://blog.golang.org/5years/gophers5th.jpg
  • 6. Web server Processes request via HTTP protocol Web Server Client
  • 7. Web server Processes request via HTTP protocol Listen a socket Receive HTTP request from the socket Web Server Client url: /blahblah, method: GET
  • 8. Web server Processes request via HTTP protocol Listen a socket Receive HTTP request from the socket Process the request Web Server Client url: /blahblah, method: GET
  • 9. Web server Processes request via HTTP protocol Listen a socket Receive HTTP request from the socket Process the request Send HTTP response to client using the socket Web Server Client url: /blahblah, method: GET Status: OK, Body: <p>welcome</p>
  • 10. (Live) Simple Golang Webserver …...
  • 11. (Live) Simple Golang Webserver …... complete net/http rules The code: https://github. com/sjp38/linuxOutYet/tree/804aa370f5adbf3d 4377ee1b1e862cbc49d81c1c
  • 12. Golang and Android ● Golang Supports Android officially from v1.4 ○ The support focus on Application; just let .so or .apk https://blog.golang.org/gopher/gopher.png http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png
  • 13. Golang and Android ● Golang Supports Android officially from v1.4 ○ The support focus on Application; just let .so or .apk ○ Requires complex build process and client code https://blog.golang.org/gopher/gopher.png http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png
  • 14. Golang and Android ● Golang Supports Android officially from v1.4 ○ The support focus on Application; just let .so or .apk ○ Requires complex build process and client code ○ Couldn’t be more simple, easier? https://blog.golang.org/gopher/gopher.png http://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png
  • 15. Golang on Android: Background Android is a variant of Linux system with ARM x86 Android exist, though... http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
  • 16. Golang on Android: Background Android is a variant of Linux system with ARM x86 Android exist, though... Go supports ARM & Linux Officially with static-linking http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
  • 17. Golang on Android: Background Android is a variant of Linux system with ARM x86 Android exist, though... Go supports ARM & Linux Officially with static-linking So, why not? http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
  • 18. Golang on Android: Plan 1. Cross compile Go program as ARM / Linux
  • 19. Golang on Android: Plan 1. Cross compile Go program as ARM / Linux 2. Include the binary in assets/ of Android app
  • 20. Golang on Android: Plan 1. Cross compile Go program as ARM / Linux 2. Include the binary in assets/ of Android app 3. Copy the binary in private space of the app
  • 21. Golang on Android: Plan 1. Cross compile Go program as ARM / Linux 2. Include the binary in assets/ of Android app 3. Copy the binary in private space of the app 4. Give execute permission to the binary /data/data/com.example.goRunner/files # ls -al -rwxrwxrwx u0_a55 u0_a55 4512840 2014-11-28 17:45 gobin
  • 22. Golang on Android: Plan 1. Cross compile Go program as ARM / Linux 2. Include the binary in assets/ of Android app 3. Copy the binary in private space of the app 4. Give execute permission to the binary 5. Execute it /data/data/com.example.goRunner/files # ls -al -rwxrwxrwx u0_a55 u0_a55 4512840 2014-11-28 17:45 gobin
  • 23. (Live) Golang on Android ……
  • 24. (Live) Golang on Android: Problem …… Not successful go binary runner code: https://github. com/sjp38/goOnAndroidFA/releases/tag/devfair 2014.gdg.kr
  • 25. (Live) Golang on Android: Problem …… Not successful It has no /etc/hosts CA Certs path is different with pure Linux /system/etc/security/cacerts
  • 26. (Live) Golang on Android: Problem …… Not successful It has no /etc/hosts CA Certs path is different with pure Linux /system/etc/security/cacerts Android is a variant of, not pure Linux GOOS=android has same problem, too :’(
  • 27. (Live) Golang on Android: Solution It has no /etc/hosts Get IP manually Certifications path is different Use those certifications
  • 28. (Live) Golang on Android: Again ……
  • 29. (Live) Golang on Android …… Complete It’s hacky, but works The code: https://github. com/sjp38/linuxOutYet/releases/tag/devfair201 4.gdg.kr
  • 30. Summary Golang program can run on Android
  • 31. Summary Golang program can run on Android Officially as .so or .apk file
  • 32. Summary Golang program can run on Android Officially as .so or .apk file Or, as elf binary with unofficial, little hack
  • 33. Summary Golang program can run on Android Officially as .so or .apk file Or, as elf binary with unofficial, little hack Some features don’t work on Android, yet Still need some hacks
  • 34. Final Source Code go web server: https://github. com/sjp38/linuxOutYet/releases/tag/devfair201 4.gdg.kr go program runner(Android app): https://github. com/sjp38/goOnAndroidFA/releases/tag/devfair 2014.gdg.kr
  • 35. This slide has been used for GDG Korea DevFair 2014 GDG Korea Golang Seoul Meetup
  • 36. This work by SeongJae Park is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http: //creativecommons.org/licenses/by-sa/3.0/.