SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
Android Development for iOS
Developers
Darryl Bayliss
@Dazindustries
Showing Content (iOS)
- Storyboards
- XIBs
- Code
override func viewDidLoad() {
super.viewDidLoad()
let textLabel = UILabel(frame: CGRectMake(40, 40, 200, 100))
textLabel.text = "Super amazing textlabel"
self.view.addSubview(textLabel)
let button = UIButton(frame: CGRectMake(50, 150, 50, 50))
button.titleLabel?.text = "Super amazing button"
self.view.addSubview(textLabel)
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
}
override func viewDidDisappear(animated: Bool) {
super.viewDidDisappear(animated)
}
Showing Content (Android)
- Navigation Editor Tool
- Layouts
- Code
@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);



LinearLayout linearLayout = new LinearLayout(this);



LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(

LinearLayout.LayoutParams.MATCH_PARENT,

LinearLayout.LayoutParams.MATCH_PARENT);



TextView textView = new TextView(this);

textView.setText("Super amazing TextView");

linearLayout.addView(textView);


Button button = new Button(this);

button.setText("Super amazing Button");

linearLayout.addView(button);



setContentView(linearLayout, layoutParams);

}



@Override

protected void onStart() {

super.onStart();

}



@Override

protected void onPause() {

super.onPause();

}
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
}
override func viewDidDisappear(animated: Bool) {
super.viewDidDisappear(animated)
}
@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

}



@Override

protected void onStart() {

super.onStart();

}



@Override

protected void onPause() {

super.onPause();

}
View Controller Lifecycles
TableViews (iOS)
- Implement the Data Source / Table View
Delegates
- Override the required methods
- Perform your logic
class tableViewController : UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
tableView.dataSource = self
tableView.delegate = self
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: UITableViewCellStyle.Value2, reuseIdentifier: nil)
cell.textLabel?.text = "Super amazing cell text"
return cell
}
}
RecyclerViews (Android)
- Create a RecyclerView
- Set RecyclerView Layout Manager
- Set RecyclerView Adapter
@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);



recyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);



LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);

recyclerView.setLayoutManager(linearLayoutManager);



recyclerView.setAdapter(new RecyclerAdapter());

}
public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> {



public static class ViewHolder extends RecyclerView.ViewHolder {



public TextView textView;

public ViewHolder(TextView textView) {

super(textView);

textView = textView;

}

}



@Override

public RecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {



TextView v = (TextView) LayoutInflater.from(parent.getContext())

.inflate(R.layout.recycler_item_textview, parent, false);



RecyclerAdapter.ViewHolder vh = new RecyclerAdapter.ViewHolder(v);

return vh;

}



@Override

public void onBindViewHolder(ViewHolder viewHolder, int i) {

viewHolder.textView.setText("Super amazing textview");

}



@Override

public int getItemCount() {

return 10;

}
User Permissions (iOS)
- Attempt to access a feature at runtime
- Handle the result
class DetailViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func showCamera(sender: UIButton) {
AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo, completionHandler: { granted in
if(granted) {
// Do camera stuff here
}
else {
// Handle user rejection
}
})
}
}
User Permissions (Android 6.0)
- Attempt to access a feature at runtime
- Handle the result
public class MainActivity extends Activity {



final int CAMERA_REQUEST_CODE = 0;

Button showCameraButton;



@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);


showCameraButton = (Button) findViewById(R.id.show_camera_button);

showCameraButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

showCamera();

}

});

}



public void showCamera() {



if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {

requestPermissions(new String[]{Manifest.permission.CAMERA}, CAMERA_REQUEST_CODE);



} else {

// ... Show camera

}

}
@Override

public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {


if (requestCode == CAMERA_REQUEST_CODE && grantResults[0] == PackageManager.PERMISSION_GRANTED) {

// ... Show Camera

}

}
}
- Android is a mess of disparate OEMs and legacy versions
- Fragmentation is a headache for developers
- Fragmentation presents a lot of problems for enterprise…
there aren’t many good solutions
The Internet Said…
Quotes from The Next Web, Open Signal & Tech Target
OS Fragmentation
AndroidiOS
Stats from Apple Developer, Android Developer
Device Screen Sizes
AndroidiOS
Screen Sizes (iOS)
- Autolayout
- Setup constraints on views to
accommodate multiple screen sizes
- Use Size Classes for fine grained
constraint control
Screen Sizes (Android)
- Views & layouts can be designed to be
pixel independent
- Android resizes layouts based on device
screen
- Can design multiple variants of the same
layout for specific device dimensions
OS Fragmentation (iOS)
- Encourage users to update for new
features
- Encourage developers to support new
features unavailable on older iOS versions
- Runtime detection of OS version in code
using Availability attributes
OS Fragmentation (Android)
- Android Support Libraries
- Provides features that are backwards
compatible to devices running old versions
of Android
- Ability to support devices running Android
1.6 (Donut)
Material Design
- Androids iOS 7 moment
- A visual language based on paper / ink
Material Design
Build Targets / Gradle
Localization
Unit Testing
UI Testing
Extensions / Intents
App Content Searching
Quiz Question #1
• Layout?
• Activity?
• Controller?
What is the Android equivalent of a UIViewController?
Quiz Question #2
• Themes?
• Styles?
• Layouts?
In Android, what are the files that hold your user interface

elements for each screen called?
Quiz Question #3
• onCreate()?
• onAppear()?
• onStart()?
What is Androids equivalent of a viewDidLoad lifecycle call?

Mais conteúdo relacionado

Mais procurados

Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptmartinlippert
 
Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App DevelopmentKetan Raval
 
Databases and NodeJS
Databases and NodeJSDatabases and NodeJS
Databases and NodeJSRiza Fahmi
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shemaMurat Gülci
 
Dominando o Data Binding no Android
Dominando o Data Binding no AndroidDominando o Data Binding no Android
Dominando o Data Binding no AndroidNelson Glauber Leal
 
Android accessibility
Android accessibilityAndroid accessibility
Android accessibilityPuneet Kumar
 

Mais procurados (9)

JQuery UI
JQuery UIJQuery UI
JQuery UI
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScript
 
Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App Development
 
Databases and NodeJS
Databases and NodeJSDatabases and NodeJS
Databases and NodeJS
 
Android query
Android queryAndroid query
Android query
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shema
 
Dominando o Data Binding no Android
Dominando o Data Binding no AndroidDominando o Data Binding no Android
Dominando o Data Binding no Android
 
Jquery ui
Jquery uiJquery ui
Jquery ui
 
Android accessibility
Android accessibilityAndroid accessibility
Android accessibility
 

Semelhante a Android development for iOS developers

Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdfImranS18
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentanistar sung
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in AndroidRobert Cooper
 
iOS Development For Android Developers
iOS Development For Android DevelopersiOS Development For Android Developers
iOS Development For Android DevelopersDarryl Bayliss
 
Connect.js - Exploring React.Native
Connect.js - Exploring React.NativeConnect.js - Exploring React.Native
Connect.js - Exploring React.Nativejoshcjensen
 
Android Custom views
Android Custom views   Android Custom views
Android Custom views Matej Vukosav
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBTAnton Yalyshev
 
Responsive mobile design in practice
Responsive mobile design in practiceResponsive mobile design in practice
Responsive mobile design in practiceKirill Grouchnikov
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversUtkarsh Mankad
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Mario Jorge Pereira
 
Application Development - Overview on Android OS
Application Development - Overview on Android OSApplication Development - Overview on Android OS
Application Development - Overview on Android OSPankaj Maheshwari
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the LollipopSonja Kesic
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsMotorola Mobility - MOTODEV
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideVisual Engineering
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsDiego Grancini
 
Optimize CollectionView Scrolling
Optimize CollectionView ScrollingOptimize CollectionView Scrolling
Optimize CollectionView ScrollingAndrea Prearo
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS DevsBarak Cohen
 

Semelhante a Android development for iOS developers (20)

Compose In Practice
Compose In PracticeCompose In Practice
Compose In Practice
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
 
iOS Development For Android Developers
iOS Development For Android DevelopersiOS Development For Android Developers
iOS Development For Android Developers
 
Connect.js - Exploring React.Native
Connect.js - Exploring React.NativeConnect.js - Exploring React.Native
Connect.js - Exploring React.Native
 
Android Custom views
Android Custom views   Android Custom views
Android Custom views
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBT
 
Responsive mobile design in practice
Responsive mobile design in practiceResponsive mobile design in practice
Responsive mobile design in practice
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
 
Application Development - Overview on Android OS
Application Development - Overview on Android OSApplication Development - Overview on Android OS
Application Development - Overview on Android OS
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the Lollipop
 
ButterKnife
ButterKnifeButterKnife
ButterKnife
 
Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on Tablets
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
 
Optimize CollectionView Scrolling
Optimize CollectionView ScrollingOptimize CollectionView Scrolling
Optimize CollectionView Scrolling
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
 

Último

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Último (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

Android development for iOS developers

  • 1. Android Development for iOS Developers Darryl Bayliss @Dazindustries
  • 2.
  • 3.
  • 4. Showing Content (iOS) - Storyboards - XIBs - Code
  • 5.
  • 6.
  • 7. override func viewDidLoad() { super.viewDidLoad() let textLabel = UILabel(frame: CGRectMake(40, 40, 200, 100)) textLabel.text = "Super amazing textlabel" self.view.addSubview(textLabel) let button = UIButton(frame: CGRectMake(50, 150, 50, 50)) button.titleLabel?.text = "Super amazing button" self.view.addSubview(textLabel) } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) } override func viewDidDisappear(animated: Bool) { super.viewDidDisappear(animated) }
  • 8. Showing Content (Android) - Navigation Editor Tool - Layouts - Code
  • 9.
  • 10.
  • 11.
  • 12. @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 
 LinearLayout linearLayout = new LinearLayout(this);
 
 LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
 LinearLayout.LayoutParams.MATCH_PARENT,
 LinearLayout.LayoutParams.MATCH_PARENT);
 
 TextView textView = new TextView(this);
 textView.setText("Super amazing TextView");
 linearLayout.addView(textView); 
 Button button = new Button(this);
 button.setText("Super amazing Button");
 linearLayout.addView(button);
 
 setContentView(linearLayout, layoutParams);
 }
 
 @Override
 protected void onStart() {
 super.onStart();
 }
 
 @Override
 protected void onPause() {
 super.onPause();
 }
  • 13. override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) } override func viewDidDisappear(animated: Bool) { super.viewDidDisappear(animated) } @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 }
 
 @Override
 protected void onStart() {
 super.onStart();
 }
 
 @Override
 protected void onPause() {
 super.onPause();
 } View Controller Lifecycles
  • 14. TableViews (iOS) - Implement the Data Source / Table View Delegates - Override the required methods - Perform your logic
  • 15. class tableViewController : UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() tableView.dataSource = self tableView.delegate = self } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 10 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = UITableViewCell(style: UITableViewCellStyle.Value2, reuseIdentifier: nil) cell.textLabel?.text = "Super amazing cell text" return cell } }
  • 16. RecyclerViews (Android) - Create a RecyclerView - Set RecyclerView Layout Manager - Set RecyclerView Adapter
  • 17. @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 
 recyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
 
 LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
 recyclerView.setLayoutManager(linearLayoutManager);
 
 recyclerView.setAdapter(new RecyclerAdapter());
 }
  • 18. public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> {
 
 public static class ViewHolder extends RecyclerView.ViewHolder {
 
 public TextView textView;
 public ViewHolder(TextView textView) {
 super(textView);
 textView = textView;
 }
 }
 
 @Override
 public RecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
 
 TextView v = (TextView) LayoutInflater.from(parent.getContext())
 .inflate(R.layout.recycler_item_textview, parent, false);
 
 RecyclerAdapter.ViewHolder vh = new RecyclerAdapter.ViewHolder(v);
 return vh;
 }
 
 @Override
 public void onBindViewHolder(ViewHolder viewHolder, int i) {
 viewHolder.textView.setText("Super amazing textview");
 }
 
 @Override
 public int getItemCount() {
 return 10;
 }
  • 19. User Permissions (iOS) - Attempt to access a feature at runtime - Handle the result
  • 20. class DetailViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func showCamera(sender: UIButton) { AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo, completionHandler: { granted in if(granted) { // Do camera stuff here } else { // Handle user rejection } }) } }
  • 21. User Permissions (Android 6.0) - Attempt to access a feature at runtime - Handle the result
  • 22. public class MainActivity extends Activity {
 
 final int CAMERA_REQUEST_CODE = 0;
 Button showCameraButton;
 
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main); 
 showCameraButton = (Button) findViewById(R.id.show_camera_button);
 showCameraButton.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
 showCamera();
 }
 });
 }
 
 public void showCamera() {
 
 if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
 requestPermissions(new String[]{Manifest.permission.CAMERA}, CAMERA_REQUEST_CODE);
 
 } else {
 // ... Show camera
 }
 } @Override
 public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { 
 if (requestCode == CAMERA_REQUEST_CODE && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
 // ... Show Camera
 }
 } }
  • 23. - Android is a mess of disparate OEMs and legacy versions - Fragmentation is a headache for developers - Fragmentation presents a lot of problems for enterprise… there aren’t many good solutions The Internet Said… Quotes from The Next Web, Open Signal & Tech Target
  • 24. OS Fragmentation AndroidiOS Stats from Apple Developer, Android Developer
  • 25.
  • 27. Screen Sizes (iOS) - Autolayout - Setup constraints on views to accommodate multiple screen sizes - Use Size Classes for fine grained constraint control
  • 28. Screen Sizes (Android) - Views & layouts can be designed to be pixel independent - Android resizes layouts based on device screen - Can design multiple variants of the same layout for specific device dimensions
  • 29.
  • 30.
  • 31. OS Fragmentation (iOS) - Encourage users to update for new features - Encourage developers to support new features unavailable on older iOS versions - Runtime detection of OS version in code using Availability attributes
  • 32. OS Fragmentation (Android) - Android Support Libraries - Provides features that are backwards compatible to devices running old versions of Android - Ability to support devices running Android 1.6 (Donut)
  • 33. Material Design - Androids iOS 7 moment - A visual language based on paper / ink
  • 35. Build Targets / Gradle Localization Unit Testing UI Testing Extensions / Intents App Content Searching
  • 36.
  • 37. Quiz Question #1 • Layout? • Activity? • Controller? What is the Android equivalent of a UIViewController?
  • 38. Quiz Question #2 • Themes? • Styles? • Layouts? In Android, what are the files that hold your user interface
 elements for each screen called?
  • 39. Quiz Question #3 • onCreate()? • onAppear()? • onStart()? What is Androids equivalent of a viewDidLoad lifecycle call?