Android and iOS differ in their project structures, components, and approaches to common tasks.
Android uses .APK files and has a project structure based on activities and fragments for screen navigation, similar to views and view controllers in iOS. It uses shared preferences like NSUserDefaults and Notifications like iOS to transfer data between screens.
iOS uses .IPA files and has a strict view controller hierarchy for navigation between screens connected by segues. It stores data in files like Core Data or SQLite similar to how Android uses files and SQLite for data transfer and storage. Both platforms support debugging and handling different device screens and densities.
6. Some other kind of facing
Declare
Import libs
Switching screen
UnitTest
ATT
7. Declare
Object object = new Object();
Student student = new Student("Nguyen Tuan Anh", "24", "Male");
Class Student{
private String name;
private int age;
private String gender;
public Student(String name, int age, String gender){
this.name = name;
this.age = age;
this.gender = gender;
}
}
8. Import Libs
Same as:
Add from static library:
.a >< .jar
Add module: same way.
Add from resource :
Cocoapod >< Maven
Podfile >< pom.xml
9. Switching screen
IOS :
Dont have default screen
Self.window setRootViewController
Using navigation controller to deligate
pushViewController
popViewController
Android:
Using IntentFilter set default screen
Throw an Intent to transfer data + switch
screen
Replace screen if using fragment
(using Support-V4 with FragmentManager)
10. Using style
Debugging
Looping: for | while | do while | ..
Constructor( init )
MultiScreen
MultiVersion
Transfer data between multible screen
13. MultiScreen
IOS:
IPad
Iphone
pixel density:
Rentina
Not rentina
Size screen:
3.5 : Ip4
4 : Ip5
4.7 : Ip6 (near future)
Something others
Android: there are many way to
understand it
Pixel density:
Mdpi
Hdpi
Xhdpi
Xxhdpi
xxxhdpi
Size screen:
Small
Normal
Large
Xlarge
XXLarge
15. Transfer data between screens
iOS:
setup next screen in current
screen & prepare data for it
before start.
Other way:
No suggest
File
SQLite
NSUserDefault
Core data (file has structure)
Android:
Same as model driven - new
way was applied this time.
Other way:
Put data into Intent as bundle
File
SQLite
SharedPreference
Simple file