SlideShare a Scribd company logo
1 of 32
Download to read offline
Developing Cordova Apps
for Ubuntu
PhoneGap Day EU 2016 Amsterdam
The Xenial Xerus is out
Celebrating Ubuntu 16.04
Convergence is now
> Ubuntu runs anywhere
> Shipping the first
convergent devices
> snappy Ubuntu Core for IoT
The Xenial Xerus is out
Celebrating Ubuntu 16.04
Extending the Ubuntu devices lineup
bq Aquaris M10
Ubuntu Edition
Meizu Pro 5
Ubuntu edition
Ubuntu for devices
Ubuntu Technologies
● Based on the central Ubuntu/Debian archive
● Mir display server
● Oxide webview, based on Chromium/Blink
● App confinement
○ Packaged (click/snap)
○ Strict application lifecycle
○ Secure, thanks to Apparmor policy-groups and platform trust-prompts
● Distribution via the Ubuntu App Store
Ubuntu for devices
Platform Services
● Content Hub
Applications can expose content outside its sandbox, to give users control over data
exchanges
● Download Manager
Offload downloads to a background service
● Media Hub
Play audio in the background, view videos with HW accelerated codecs
● URL dispatcher
Linking to your app made easy
Ubuntu for devices
Platform Services (contd)
● Push notifications
Receive notifications from the network, filter and resume
an app
● Online accounts
User identities managed by the system, for OAuth based
services
Apps can only use those once the user has explicitly
granted permission
More on developer.ubuntu.com
Getting started
Development environment
Install an Ubuntu VM
Add Ubuntu SDK packages
Install cordova-cli
Check your setup
Development environment
1
2
3
4
Development environment
Installing an Ubuntu VM
Install from an ISO image
Or copy the Virtualbox provided during the workshop
mkdir devbox; cd devbox
vagrant init ubuntu/xenial64
# add this to your Vagrantfile
config.vm.provider "virtualbox" do |vb|
vb.name = "devbox"
end
vagrant up
vagrant ssh
sudo vi /etc/hosts # add ubuntu-xenial to localhost
sudo passwd # fix the password / login problem
scp -P 2222 -i .vagrant/machines/default/virtualbox/private_key packages/*
ubuntu@127.0.0.1:/var/cache/apt/archives/
1
Development environment
Add the Ubuntu SDK packages
● This is already included in the vagrant box...
sudo apt-add-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
# this will create a clean click chroot build environment
sudo apt-get install click-dev phablet-tools ubuntu-sdk-api-15.04
# add build dependencies inside the click chroot
sudo click chroot -a armhf -f ubuntu-sdk-15.04 install cmake libicu-dev:armhf pkg-
config qtbase5-dev:armhf qtchooser qtdeclarative5-dev:armhf qtfeedback5-dev:armhf
qtlocation5-dev:armhf qtmultimedia5-dev:armhf qtpim5-dev:armhf libqt5sensors5-dev:
armhf qtsystems5-dev:armhf
2
Development environment
Install cordova-cli
● 4.3.x is still the recommended path
● The debian package has fixes in cordova-lib
sudo apt-add-repository ppa:cordova-ubuntu/ppa
sudo apt-get update
sudo apt-get install cordova-cli
cordova -v
4.3.1
cordova create testapp testapp.pgdayeu "test app"
# cordova-ubuntu github master has the latest release (4.3.4 currently)
cordova platform add https://github.com/cordova-ubuntu/cordova-ubuntu
3
Development environment
Check your setup
● Add a USB port to the VM
● Connect an Ubuntu phone
sudo adb kill-server
sudo adb start-server
# should display the list of visible devices
adb devices
# just in case...
ssh-keygen
# log into the phone
phablet-shell
3
Run and debug
Running a Cordova app on Ubuntu
cordova run --device
What it does is:
- Build the app & plugin runtime
- Package the result in a .click file
- Connects over ADB to the device
- Stop the application if it was already running
- Installs the app via pkcon local-install --allow-untrusted
- Start the app with ubuntu-app-launch <app id>
Debugging tools
Chrome Devtools support
cordova run --device -- --debug
App logs on the phone
phablet-shell
tail -f ~/.cache/upstart/application-click-<your app id>.log
Detailed build logs
cordova -d build --device -- --verbose
Ubuntu Cordova
Application Development
Plugins
Using plugins
● We maintain our ports for most of the core plugins,
● The more up to date versions can be found in our github repos:
https://github.com/cordova-ubuntu
● We are increasing our core and extra plugins support
○ File transfer platform support
○ BLE/Bluetooth plugin (based on Don Coleman’s API)
○ Planning to release plugins for specific platform supports (Content hub, Online
Accounts, …)
Using plugins (contd)
● Sample usage for plugins:
○ https://github.com/cordova-ubuntu/ubuntu-demo
cordova plugin add https://github.com/apache/cordova-plugin-compat.git
cordova plugin add https://github.com/apache/cordova-plugin-camera.git
cordova plugin add https://github.com/apache/cordova-plugin-device.git
cordova plugin add https://github.com/apache/cordova-plugin-device-motion.git
cordova plugin add https://github.com/cordova-ubuntu/cordova-plugin-geolocation.git
cordova plugin add https://github.com/cordova-ubuntu/cordova-plugin-ble-central.git
cordova plugin add https://github.com/cordova-ubuntu/cordova-plugin-vibration.git
(Some plugins are in the process of being upstreamed with updates)
Cordova and Ionic for your
Ubuntu App
Install Ionic and run the sample app
cd ~/
npm install ionic # note: no need to use -g
export PATH=~/node_modules/.bin:$PATH
ionic start ionicapp
cd ionicapp
# add platform
ln -s ionic.png www/img/logo.png # grmbl…
cordova platform add https://github.com/cordova-ubuntu/cordova-ubuntu
ionic run --device
Publishing your app
The Ubuntu App Store
Ubuntu Store
● Application packaged as a “click”
● Click package created when running
cordova build --device
● Upload to the store from
○ https://myapps.developer.ubuntu.com/dev/click-apps/
○ quick automated approval with automated click introspection
Ubuntu Cordova
Development: What’s
next?
Convergence, IoT
Convergence
● Range of supported form factors expanding
● Unity8 to “rule them all” with flexibility
● Adaptive behavior
○ Dynamic over US B or wifi connection to HDMI monitor
○ Bluetooth keyboard, mouse
● Applications should be responsive
Design Guidelines for Convergence
Ubuntu UI design guidelines, examples & assets
○ http://design.ubuntu.com/apps
■ Navigation concepts
■ Presentation guidelines
○ http://design.ubuntu.com/examples
○ http://design.ubuntu.com/downloads
Community supported HTML5 UI templates & SDK:
○ https://code.launchpad.net/~ubuntu-html5-theme-devs/ubuntu-html5-
theme/trunk
○ Support for most of the widgets & ubuntu elements
○ Core can easily be embedded
IoT
● Snappy Ubuntu Core
A new, transactionally-updated Ubuntu for IoT
devices, clouds and more
● Connect to devices from your Cordova app
● New cordova-plugin-ble-central for Ubuntu
● Demo
Sample BLE code
Connect your app to an Ubuntu device, with Bluetooth Low Energy !
function deviceDiscovered(device) {
if (device.name.match(/sensor/i)) {
var tags = self._ui.list("#sensortags");
tags.append(device.name + ", " + device.id, null, null,
function (target, thisdevice) {
ble.connect(device.id, onConnect, bleError);
}, device);
}
};
function bleError(msg) {}
plugins.append("BLE SensorTag",
null,
null,
function (target, result_infos) {
self._ui.pagestack.push("plugin-ble");
ble.scan([], 5, deviceDiscovered, bleError);
});
Developing Apps for Ubuntu
PhoneGap Day EU 2016 Amsterdam

More Related Content

Recently uploaded

Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 

Recently uploaded (20)

Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Developing Cordova Apps for Ubuntu

  • 1. Developing Cordova Apps for Ubuntu PhoneGap Day EU 2016 Amsterdam
  • 2. The Xenial Xerus is out Celebrating Ubuntu 16.04
  • 3. Convergence is now > Ubuntu runs anywhere > Shipping the first convergent devices > snappy Ubuntu Core for IoT
  • 4. The Xenial Xerus is out Celebrating Ubuntu 16.04 Extending the Ubuntu devices lineup bq Aquaris M10 Ubuntu Edition Meizu Pro 5 Ubuntu edition
  • 5. Ubuntu for devices Ubuntu Technologies ● Based on the central Ubuntu/Debian archive ● Mir display server ● Oxide webview, based on Chromium/Blink ● App confinement ○ Packaged (click/snap) ○ Strict application lifecycle ○ Secure, thanks to Apparmor policy-groups and platform trust-prompts ● Distribution via the Ubuntu App Store
  • 6. Ubuntu for devices Platform Services ● Content Hub Applications can expose content outside its sandbox, to give users control over data exchanges ● Download Manager Offload downloads to a background service ● Media Hub Play audio in the background, view videos with HW accelerated codecs ● URL dispatcher Linking to your app made easy
  • 7. Ubuntu for devices Platform Services (contd) ● Push notifications Receive notifications from the network, filter and resume an app ● Online accounts User identities managed by the system, for OAuth based services Apps can only use those once the user has explicitly granted permission
  • 10. Install an Ubuntu VM Add Ubuntu SDK packages Install cordova-cli Check your setup Development environment 1 2 3 4
  • 11. Development environment Installing an Ubuntu VM Install from an ISO image Or copy the Virtualbox provided during the workshop mkdir devbox; cd devbox vagrant init ubuntu/xenial64 # add this to your Vagrantfile config.vm.provider "virtualbox" do |vb| vb.name = "devbox" end vagrant up vagrant ssh sudo vi /etc/hosts # add ubuntu-xenial to localhost sudo passwd # fix the password / login problem scp -P 2222 -i .vagrant/machines/default/virtualbox/private_key packages/* ubuntu@127.0.0.1:/var/cache/apt/archives/ 1
  • 12. Development environment Add the Ubuntu SDK packages ● This is already included in the vagrant box... sudo apt-add-repository ppa:ubuntu-sdk-team/ppa sudo apt-get update # this will create a clean click chroot build environment sudo apt-get install click-dev phablet-tools ubuntu-sdk-api-15.04 # add build dependencies inside the click chroot sudo click chroot -a armhf -f ubuntu-sdk-15.04 install cmake libicu-dev:armhf pkg- config qtbase5-dev:armhf qtchooser qtdeclarative5-dev:armhf qtfeedback5-dev:armhf qtlocation5-dev:armhf qtmultimedia5-dev:armhf qtpim5-dev:armhf libqt5sensors5-dev: armhf qtsystems5-dev:armhf 2
  • 13. Development environment Install cordova-cli ● 4.3.x is still the recommended path ● The debian package has fixes in cordova-lib sudo apt-add-repository ppa:cordova-ubuntu/ppa sudo apt-get update sudo apt-get install cordova-cli cordova -v 4.3.1 cordova create testapp testapp.pgdayeu "test app" # cordova-ubuntu github master has the latest release (4.3.4 currently) cordova platform add https://github.com/cordova-ubuntu/cordova-ubuntu 3
  • 14. Development environment Check your setup ● Add a USB port to the VM ● Connect an Ubuntu phone sudo adb kill-server sudo adb start-server # should display the list of visible devices adb devices # just in case... ssh-keygen # log into the phone phablet-shell 3
  • 16. Running a Cordova app on Ubuntu cordova run --device What it does is: - Build the app & plugin runtime - Package the result in a .click file - Connects over ADB to the device - Stop the application if it was already running - Installs the app via pkcon local-install --allow-untrusted - Start the app with ubuntu-app-launch <app id>
  • 17. Debugging tools Chrome Devtools support cordova run --device -- --debug App logs on the phone phablet-shell tail -f ~/.cache/upstart/application-click-<your app id>.log Detailed build logs cordova -d build --device -- --verbose
  • 19. Using plugins ● We maintain our ports for most of the core plugins, ● The more up to date versions can be found in our github repos: https://github.com/cordova-ubuntu ● We are increasing our core and extra plugins support ○ File transfer platform support ○ BLE/Bluetooth plugin (based on Don Coleman’s API) ○ Planning to release plugins for specific platform supports (Content hub, Online Accounts, …)
  • 20. Using plugins (contd) ● Sample usage for plugins: ○ https://github.com/cordova-ubuntu/ubuntu-demo cordova plugin add https://github.com/apache/cordova-plugin-compat.git cordova plugin add https://github.com/apache/cordova-plugin-camera.git cordova plugin add https://github.com/apache/cordova-plugin-device.git cordova plugin add https://github.com/apache/cordova-plugin-device-motion.git cordova plugin add https://github.com/cordova-ubuntu/cordova-plugin-geolocation.git cordova plugin add https://github.com/cordova-ubuntu/cordova-plugin-ble-central.git cordova plugin add https://github.com/cordova-ubuntu/cordova-plugin-vibration.git (Some plugins are in the process of being upstreamed with updates)
  • 21.
  • 22. Cordova and Ionic for your Ubuntu App
  • 23. Install Ionic and run the sample app cd ~/ npm install ionic # note: no need to use -g export PATH=~/node_modules/.bin:$PATH ionic start ionicapp cd ionicapp # add platform ln -s ionic.png www/img/logo.png # grmbl… cordova platform add https://github.com/cordova-ubuntu/cordova-ubuntu ionic run --device
  • 24.
  • 25. Publishing your app The Ubuntu App Store
  • 26. Ubuntu Store ● Application packaged as a “click” ● Click package created when running cordova build --device ● Upload to the store from ○ https://myapps.developer.ubuntu.com/dev/click-apps/ ○ quick automated approval with automated click introspection
  • 28. Convergence ● Range of supported form factors expanding ● Unity8 to “rule them all” with flexibility ● Adaptive behavior ○ Dynamic over US B or wifi connection to HDMI monitor ○ Bluetooth keyboard, mouse ● Applications should be responsive
  • 29. Design Guidelines for Convergence Ubuntu UI design guidelines, examples & assets ○ http://design.ubuntu.com/apps ■ Navigation concepts ■ Presentation guidelines ○ http://design.ubuntu.com/examples ○ http://design.ubuntu.com/downloads Community supported HTML5 UI templates & SDK: ○ https://code.launchpad.net/~ubuntu-html5-theme-devs/ubuntu-html5- theme/trunk ○ Support for most of the widgets & ubuntu elements ○ Core can easily be embedded
  • 30. IoT ● Snappy Ubuntu Core A new, transactionally-updated Ubuntu for IoT devices, clouds and more ● Connect to devices from your Cordova app ● New cordova-plugin-ble-central for Ubuntu ● Demo
  • 31. Sample BLE code Connect your app to an Ubuntu device, with Bluetooth Low Energy ! function deviceDiscovered(device) { if (device.name.match(/sensor/i)) { var tags = self._ui.list("#sensortags"); tags.append(device.name + ", " + device.id, null, null, function (target, thisdevice) { ble.connect(device.id, onConnect, bleError); }, device); } }; function bleError(msg) {} plugins.append("BLE SensorTag", null, null, function (target, result_infos) { self._ui.pagestack.push("plugin-ble"); ble.scan([], 5, deviceDiscovered, bleError); });
  • 32. Developing Apps for Ubuntu PhoneGap Day EU 2016 Amsterdam