SlideShare a Scribd company logo
1 of 13
Download to read offline
Android develop Guideline
Index:
Getting start a project
- Environments
- IDE of Android development
- Android SDK version
- Java compiler
- Building system
- Emulator
- Coding Style
- Code Style
- Use Editorconfig
- Reformat code
- Workflow
- Scrum
- Importance of teamwork
- Mindsets
- Sharing
- References
Appendix:
Advance for a project
- Best practices
- Best resources
Training
Getting start a project
Environments
IDE of Android development
Android Studio
We use ​Android Studio​ as our IDE in Android team and should stay using the newest stable
version. How to Install Android studio please refer ​Android developer official site​. Following is
Android Studio configurations:
- Please turn on `Automatically check updates for ​Stable Channel​`
Config Lint
Android Level Lint
We should use the default Lint configuration (e.g., ​origami_lint_baseline.xml​) in the team.
(​https://developer.android.com/studio/write/lint.html​)
Java Level Lint:
Since it can be config in Lint configuration that supported by Android we should config manually.
Below those configs we should enable and make it as `warning` or `error` severity.
- Since efficiency issue please turn on `Private member access between outer and inner
classes` in `Editor > Inspections` as ​Error​ severity.
- Keeping updating
Live Template
Consider the consistent code style and avoid human error, and it can raise efficient while
coding. We should be used to it.
For example when writing a condition of checking null object (It is not default template).
Type `​ifn​` then the prompt will show up.
Select it then generate the code template and you should fill up the variables.
Hotkeys
Consider the consistent code style and avoid human error, and it can raise efficient while
coding. We should be used to it.
For example,
Lookup the parameter hint of a method.
Press `​Command (Ctrl for Windows) + P​` on a method calling.
Android SDK version
Minimal SDK version: `​Android 4.0.3 (Ice cream sandwich) API15`​ (but should higher than
dependencies).
Target SDK version: `​Always last version`​ (i.e., Android 7.0 (Nougat) API 24 so far)
Compile SDK version: `​Always last version`​ (i.e., Android 7.0 (Nougat) API 24 so far)
Ref:
https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsd
kversion-a098a0341ebd#.we0do6qn7
Java compiler
Please keep your Java Development Kit (JDK) version is ​latest version​.
(For Android Library)​ You should also keep the java compatibility as following configuration:
`Source Compatibility Version: ​Java Version 1.7​`
`Target Compatibility Version: ​Java Version 1.7​`
(For Android Application) ​Recommended using `Jack`: Since there some issues between
Oracle’s Java compiler and Android Java compiler. And there is no reason Java compiler does
optimize for Android. So in the team, we courage to use a Java compiler that able to optimize
for Android and help our app to get more efficiency.
Jack toolchain​:
>>> Jack is a new Android toolchain that compiles Java source into Android dex bytecode. It
replaces the previous Android toolchain, which consists of multiple tools, such as javac,
ProGuard, jarjar, and dx.
(link: ​https://source.android.com/source/jack.html​)
How to enable Jack:
https://developer.android.com/guide/platform/j8-jack.html#configuration
```
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
```
Building system
According to the default build system in Android Studio is ​Gradle​ and we need build variety of
app version for different purposes. You should use Gradle as your build system in Android
development. Please refer `​Config you Build​`.
Emulator
Two Android emulator.
- Official Android Emulator
- Genymotion Android Emulator​ - ​Personal Version in Free
Coding Style
Code Style
Refer to ​https://source.android.com/source/code-style.html
Above link that includes basic rule of coding and styling of your code. Just considering it as the
common Java coding style so we also follow the rules. Here is examples,
Comments​:
```
/**
* Constructs a new String by converting the specified array of
* bytes using the platform's default character encoding.
*/
public String(byte[] bytes) {
...
}
```
Define Fields in Standard Places​:
Define fields either at the top of the file or immediately before the methods that use them.
```
class Foo {
String bar;
void func() {
String fields;
}
}
```
Limit Variable Scope​:
```
// Instantiate class cl, which represents some sort of Set
Set s = null;
try {
s = (Set) cl.newInstance();
} catch(IllegalAccessException e) {
throw new IllegalArgumentException(cl + " not accessible");
} catch(InstantiationException e) {
throw new IllegalArgumentException(cl + " not instantiable");
}
// Exercise the set
s.addAll(Arrays.asList(args));
```
```
for (int i = 0; i < n; i++) {
doSomething(i);
}
```
Use Spaces for Indentation​:
We use ​four​ (`4`) space indents for blocks and never tabs. When in doubt, be consistent with
the surrounding code.
```
for (Iterator i = c.iterator(); i.hasNext(); ) {
doSomethingElse(i.next());
}
```
We use ​eight​ (`8`) space indents for line wraps, including function calls and assignments. For
example, this is correct:
```
Instrument i =
someLongExpression(that, wouldNotFit, on, one, line);
```
Follow Field Naming Conventions
- Non-public, non-static field names start with m. ​(TBD)
- Static field names start with s. ​(TBD)
- Other fields start with a lower case letter.
- Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.
```
public class MyClass {
public static final int SOME_CONSTANT = 42;
public int publicField;
private static MyClass sSingleton;
int mPackagePrivate;
private int mPrivate;
protected int mProtected;
}
```
Use Standard Brace Style
```
class MyClass {
int func() {
if (something) {
// ...
} else if (somethingElse) {
// ...
} else {
// ...
}
}
}
```
```
if (condition)
body(); ​// bad!
```
Limit Line Length
Each line of text in your code should be at most ​100​ characters long. While much discussion
has surrounded this rule, the decision remains that 100 characters is the maximum with the
following exceptions:
If a comment line contains an example command or a literal URL longer than ​100​ characters,
that line may be longer than ​100​ characters for ease of cut and paste.
Import lines can go over the limit because humans rarely see them (this also simplifies tool
writing).
Use TODO Comments
```
// TODO: Remove this code after the Url Table2 has been checked in.
```
Use Editorconfig
Android Studio (IntelliJ) enable ​Editorconfig​ plugin as default and it’s supported by most of
popular IDE. So we use Editorconfig as our code style configuration.
Reformat code
Keep often formatting your code with,
Workflow
Scrum
>>> Scrum is an iterative and incremental agile software development framework for managing
product development. It defines "a flexible, holistic product development strategy where a
development team works as a unit to reach a common goal", challenges assumptions of the
"traditional, sequential approach" to product development, and enables teams to self-organize
by encouraging physical co-location or close online collaboration of all team members, as well
as daily face-to-face communication among all team members and disciplines involved.
From ​Wikipedia
Basically we do each Scrum sprint in two weeks. First, to plan Sprint. Show the progress
everyday and review how the progress and determine release app or not in the second week.
For more detail please see the ​page​.
Software engineering development flow
Design -> Implement ->​ Test
Importance of teamwork
Teamwork Mindsets
- Communication with members anytime
- Use project tools, i.e., Gitlab. And control the source code.
- Before changing the code, you must discuss with your member who is original author of
the code if the member still be in here.
- Keep discussing if you have not get to understand.
- Keep finding root cause of an issue or a bug. Solve problem permanently is the most
important.
- Rather found error on compile time and not happend error on runtime.
- Found crashes or bugs on develop version (as early as possible) and not release
version.
Sharing
Keep sharing in Android team. If you found any interesting post about Android or you want to
recommend any helpful article you should feel free share it to other members. Or you can
schedule a meeting to give an introduction or explanation.
References
- Android Studio
- Picking your SDK version
- Java SE Download
- Jack
- Enable Java 8 Features and the Jack Toolchain
- Gradle
- Android Gradle
- Config your Build
- Android Emulator
- Genymotion
- Code Style for Contributors
- Editorconfig
Advance for a project
Best practices
- Best Practices for Performance
- Best practices in Android development
- Avoiding Memory Leak​ (​Android Memory Leak Pattern​)
Best resources
- Must have libraries
- Android Drawables
- Jake Wharton’s presentations
- Awesome Android UI
- Awesome Android Libraries
Training
Official Android Developer site is always the best ​training sites​. Followings are the must read
articles of learning developing with Android.
- Building Your First App
- Supporting Different Devices
- Managing the Activity Lifecycle
- Building a Dynamic UI with Fragments
- Best Practices for Performance

More Related Content

What's hot

3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION APIGavin Pickin
 
Testing Legacy Rails Apps
Testing Legacy Rails AppsTesting Legacy Rails Apps
Testing Legacy Rails AppsRabble .
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF SummitOrtus Solutions, Corp
 
Foundations of Zend Framework
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend FrameworkAdam Culp
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Robin O'Brien
 
Lecture java basics
Lecture   java basicsLecture   java basics
Lecture java basicseleksdev
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleNoam Kfir
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentationolegkrivtsov
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In ActionHazem Saleh
 
03 Beginning Android Application Development
03 Beginning Android Application Development03 Beginning Android Application Development
03 Beginning Android Application DevelopmentArief Gunawan
 
Stopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestStopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy codeLars Thorup
 
Declarative Input Validation with JSR 303 and ExtVal
Declarative Input Validation with JSR 303 and ExtValDeclarative Input Validation with JSR 303 and ExtVal
Declarative Input Validation with JSR 303 and ExtValBart Kummel
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econTom Schindl
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDISven Ruppert
 
Pharo Optimising JIT Internals
Pharo Optimising JIT InternalsPharo Optimising JIT Internals
Pharo Optimising JIT InternalsESUG
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 

What's hot (20)

3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
 
Testing Legacy Rails Apps
Testing Legacy Rails AppsTesting Legacy Rails Apps
Testing Legacy Rails Apps
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
 
Foundations of Zend Framework
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend Framework
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
 
Webinar on Google Android SDK
Webinar on Google Android SDKWebinar on Google Android SDK
Webinar on Google Android SDK
 
Lecture java basics
Lecture   java basicsLecture   java basics
Lecture java basics
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black Hole
 
Using Zend Framework 2 Book Presentation
Using Zend Framework 2 Book PresentationUsing Zend Framework 2 Book Presentation
Using Zend Framework 2 Book Presentation
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
 
03 Beginning Android Application Development
03 Beginning Android Application Development03 Beginning Android Application Development
03 Beginning Android Application Development
 
Stopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestStopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under Test
 
Unit testing legacy code
Unit testing legacy codeUnit testing legacy code
Unit testing legacy code
 
Declarative Input Validation with JSR 303 and ExtVal
Declarative Input Validation with JSR 303 and ExtValDeclarative Input Validation with JSR 303 and ExtVal
Declarative Input Validation with JSR 303 and ExtVal
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econ
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Mpl 1
Mpl 1Mpl 1
Mpl 1
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDI
 
Pharo Optimising JIT Internals
Pharo Optimising JIT InternalsPharo Optimising JIT Internals
Pharo Optimising JIT Internals
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 

Similar to Android develop guideline

Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application DevelopmentRamesh Prasad
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programmingmaznabili
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersRutenis Turcinas
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the CloudJim Driscoll
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDKKirill Kounik
 
3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API - 3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API - Ortus Solutions, Corp
 
Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Bohdan Dovhań
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Somkiat Khitwongwattana
 
Bdd Net Frameworks
Bdd Net FrameworksBdd Net Frameworks
Bdd Net Frameworkshdgarcia
 
Angular4 getting started
Angular4 getting startedAngular4 getting started
Angular4 getting startedTejinderMakkar
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software DevelopmentZeeshan MIrza
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginXavier Hallade
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereLaurence Svekis ✔
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplateStanislav Petrov
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 

Similar to Android develop guideline (20)

Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programming
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack Developers
 
Introduction to Programming Lesson 01
Introduction to Programming Lesson 01Introduction to Programming Lesson 01
Introduction to Programming Lesson 01
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
 
3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API - 3 WAYS TO TEST YOUR COLDFUSION API -
3 WAYS TO TEST YOUR COLDFUSION API -
 
Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
 
Bdd Net Frameworks
Bdd Net FrameworksBdd Net Frameworks
Bdd Net Frameworks
 
Angular4 getting started
Angular4 getting startedAngular4 getting started
Angular4 getting started
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 

More from Kan-Han (John) Lu

Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategyKan-Han (John) Lu
 
Deep neural network for youtube recommendations
Deep neural network for youtube recommendationsDeep neural network for youtube recommendations
Deep neural network for youtube recommendationsKan-Han (John) Lu
 
Twitter as a personalizable information service ii
Twitter as a personalizable information service iiTwitter as a personalizable information service ii
Twitter as a personalizable information service iiKan-Han (John) Lu
 
Multimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimediaMultimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimediaKan-Han (John) Lu
 
ARM: Trusted Zone on Android
ARM: Trusted Zone on AndroidARM: Trusted Zone on Android
ARM: Trusted Zone on AndroidKan-Han (John) Lu
 
Android Training - Card Style
Android Training - Card StyleAndroid Training - Card Style
Android Training - Card StyleKan-Han (John) Lu
 
Android Training - View Pager
Android Training - View PagerAndroid Training - View Pager
Android Training - View PagerKan-Han (John) Lu
 
Android Training - Sliding Menu
Android Training - Sliding MenuAndroid Training - Sliding Menu
Android Training - Sliding MenuKan-Han (John) Lu
 
Android Training - Pull to Refresh
Android Training - Pull to RefreshAndroid Training - Pull to Refresh
Android Training - Pull to RefreshKan-Han (John) Lu
 
Code analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMDCode analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMDKan-Han (John) Lu
 
Android Training - Content Sharing
Android Training - Content SharingAndroid Training - Content Sharing
Android Training - Content SharingKan-Han (John) Lu
 
Android Training - Action Bar
Android Training - Action BarAndroid Training - Action Bar
Android Training - Action BarKan-Han (John) Lu
 

More from Kan-Han (John) Lu (20)

Dagger for android
Dagger for androidDagger for android
Dagger for android
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategy
 
Deep neural network for youtube recommendations
Deep neural network for youtube recommendationsDeep neural network for youtube recommendations
Deep neural network for youtube recommendations
 
Android testing part i
Android testing part iAndroid testing part i
Android testing part i
 
Cuda project paper
Cuda project paperCuda project paper
Cuda project paper
 
Twitter as a personalizable information service ii
Twitter as a personalizable information service iiTwitter as a personalizable information service ii
Twitter as a personalizable information service ii
 
Multimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimediaMultimedia data minig and analytics sentiment analysis using social multimedia
Multimedia data minig and analytics sentiment analysis using social multimedia
 
Android IPC: Binder
Android IPC: BinderAndroid IPC: Binder
Android IPC: Binder
 
ARM: Trusted Zone on Android
ARM: Trusted Zone on AndroidARM: Trusted Zone on Android
ARM: Trusted Zone on Android
 
Android Training - Card Style
Android Training - Card StyleAndroid Training - Card Style
Android Training - Card Style
 
Android Training - View Pager
Android Training - View PagerAndroid Training - View Pager
Android Training - View Pager
 
Android Training - Sliding Menu
Android Training - Sliding MenuAndroid Training - Sliding Menu
Android Training - Sliding Menu
 
Android Training - Pull to Refresh
Android Training - Pull to RefreshAndroid Training - Pull to Refresh
Android Training - Pull to Refresh
 
Java: Exception Handling
Java: Exception HandlingJava: Exception Handling
Java: Exception Handling
 
Dynamic Proxy by Java
Dynamic Proxy by JavaDynamic Proxy by Java
Dynamic Proxy by Java
 
Code analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMDCode analyzer: FindBugs and PMD
Code analyzer: FindBugs and PMD
 
Android UI System
Android UI SystemAndroid UI System
Android UI System
 
Android Fragment
Android FragmentAndroid Fragment
Android Fragment
 
Android Training - Content Sharing
Android Training - Content SharingAndroid Training - Content Sharing
Android Training - Content Sharing
 
Android Training - Action Bar
Android Training - Action BarAndroid Training - Action Bar
Android Training - Action Bar
 

Recently uploaded

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 

Recently uploaded (20)

(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 

Android develop guideline

  • 1. Android develop Guideline Index: Getting start a project - Environments - IDE of Android development - Android SDK version - Java compiler - Building system - Emulator - Coding Style - Code Style - Use Editorconfig - Reformat code - Workflow - Scrum - Importance of teamwork - Mindsets - Sharing - References Appendix: Advance for a project - Best practices - Best resources Training Getting start a project Environments
  • 2. IDE of Android development Android Studio We use ​Android Studio​ as our IDE in Android team and should stay using the newest stable version. How to Install Android studio please refer ​Android developer official site​. Following is Android Studio configurations: - Please turn on `Automatically check updates for ​Stable Channel​` Config Lint Android Level Lint We should use the default Lint configuration (e.g., ​origami_lint_baseline.xml​) in the team. (​https://developer.android.com/studio/write/lint.html​) Java Level Lint: Since it can be config in Lint configuration that supported by Android we should config manually. Below those configs we should enable and make it as `warning` or `error` severity. - Since efficiency issue please turn on `Private member access between outer and inner classes` in `Editor > Inspections` as ​Error​ severity.
  • 4. Live Template Consider the consistent code style and avoid human error, and it can raise efficient while coding. We should be used to it. For example when writing a condition of checking null object (It is not default template). Type `​ifn​` then the prompt will show up. Select it then generate the code template and you should fill up the variables.
  • 5. Hotkeys Consider the consistent code style and avoid human error, and it can raise efficient while coding. We should be used to it. For example, Lookup the parameter hint of a method. Press `​Command (Ctrl for Windows) + P​` on a method calling. Android SDK version Minimal SDK version: `​Android 4.0.3 (Ice cream sandwich) API15`​ (but should higher than dependencies). Target SDK version: `​Always last version`​ (i.e., Android 7.0 (Nougat) API 24 so far) Compile SDK version: `​Always last version`​ (i.e., Android 7.0 (Nougat) API 24 so far) Ref: https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsd kversion-a098a0341ebd#.we0do6qn7
  • 6. Java compiler Please keep your Java Development Kit (JDK) version is ​latest version​. (For Android Library)​ You should also keep the java compatibility as following configuration: `Source Compatibility Version: ​Java Version 1.7​` `Target Compatibility Version: ​Java Version 1.7​` (For Android Application) ​Recommended using `Jack`: Since there some issues between Oracle’s Java compiler and Android Java compiler. And there is no reason Java compiler does optimize for Android. So in the team, we courage to use a Java compiler that able to optimize for Android and help our app to get more efficiency. Jack toolchain​: >>> Jack is a new Android toolchain that compiles Java source into Android dex bytecode. It replaces the previous Android toolchain, which consists of multiple tools, such as javac, ProGuard, jarjar, and dx. (link: ​https://source.android.com/source/jack.html​) How to enable Jack: https://developer.android.com/guide/platform/j8-jack.html#configuration ``` android { ... defaultConfig { ... jackOptions { enabled true } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } ```
  • 7. Building system According to the default build system in Android Studio is ​Gradle​ and we need build variety of app version for different purposes. You should use Gradle as your build system in Android development. Please refer `​Config you Build​`. Emulator Two Android emulator. - Official Android Emulator - Genymotion Android Emulator​ - ​Personal Version in Free Coding Style Code Style Refer to ​https://source.android.com/source/code-style.html Above link that includes basic rule of coding and styling of your code. Just considering it as the common Java coding style so we also follow the rules. Here is examples, Comments​: ``` /** * Constructs a new String by converting the specified array of * bytes using the platform's default character encoding. */ public String(byte[] bytes) { ... } ``` Define Fields in Standard Places​: Define fields either at the top of the file or immediately before the methods that use them. ``` class Foo { String bar; void func() { String fields; }
  • 8. } ``` Limit Variable Scope​: ``` // Instantiate class cl, which represents some sort of Set Set s = null; try { s = (Set) cl.newInstance(); } catch(IllegalAccessException e) { throw new IllegalArgumentException(cl + " not accessible"); } catch(InstantiationException e) { throw new IllegalArgumentException(cl + " not instantiable"); } // Exercise the set s.addAll(Arrays.asList(args)); ``` ``` for (int i = 0; i < n; i++) { doSomething(i); } ``` Use Spaces for Indentation​: We use ​four​ (`4`) space indents for blocks and never tabs. When in doubt, be consistent with the surrounding code. ``` for (Iterator i = c.iterator(); i.hasNext(); ) { doSomethingElse(i.next()); } ``` We use ​eight​ (`8`) space indents for line wraps, including function calls and assignments. For example, this is correct: ``` Instrument i = someLongExpression(that, wouldNotFit, on, one, line); ```
  • 9. Follow Field Naming Conventions - Non-public, non-static field names start with m. ​(TBD) - Static field names start with s. ​(TBD) - Other fields start with a lower case letter. - Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES. ``` public class MyClass { public static final int SOME_CONSTANT = 42; public int publicField; private static MyClass sSingleton; int mPackagePrivate; private int mPrivate; protected int mProtected; } ``` Use Standard Brace Style ``` class MyClass { int func() { if (something) { // ... } else if (somethingElse) { // ... } else { // ... } } } ``` ``` if (condition) body(); ​// bad! ```
  • 10. Limit Line Length Each line of text in your code should be at most ​100​ characters long. While much discussion has surrounded this rule, the decision remains that 100 characters is the maximum with the following exceptions: If a comment line contains an example command or a literal URL longer than ​100​ characters, that line may be longer than ​100​ characters for ease of cut and paste. Import lines can go over the limit because humans rarely see them (this also simplifies tool writing). Use TODO Comments ``` // TODO: Remove this code after the Url Table2 has been checked in. ``` Use Editorconfig Android Studio (IntelliJ) enable ​Editorconfig​ plugin as default and it’s supported by most of popular IDE. So we use Editorconfig as our code style configuration. Reformat code Keep often formatting your code with,
  • 11. Workflow Scrum >>> Scrum is an iterative and incremental agile software development framework for managing product development. It defines "a flexible, holistic product development strategy where a development team works as a unit to reach a common goal", challenges assumptions of the "traditional, sequential approach" to product development, and enables teams to self-organize by encouraging physical co-location or close online collaboration of all team members, as well as daily face-to-face communication among all team members and disciplines involved. From ​Wikipedia Basically we do each Scrum sprint in two weeks. First, to plan Sprint. Show the progress everyday and review how the progress and determine release app or not in the second week. For more detail please see the ​page​. Software engineering development flow Design -> Implement ->​ Test Importance of teamwork Teamwork Mindsets - Communication with members anytime - Use project tools, i.e., Gitlab. And control the source code. - Before changing the code, you must discuss with your member who is original author of the code if the member still be in here. - Keep discussing if you have not get to understand. - Keep finding root cause of an issue or a bug. Solve problem permanently is the most important. - Rather found error on compile time and not happend error on runtime. - Found crashes or bugs on develop version (as early as possible) and not release version. Sharing Keep sharing in Android team. If you found any interesting post about Android or you want to recommend any helpful article you should feel free share it to other members. Or you can schedule a meeting to give an introduction or explanation.
  • 12. References - Android Studio - Picking your SDK version - Java SE Download - Jack - Enable Java 8 Features and the Jack Toolchain - Gradle - Android Gradle - Config your Build - Android Emulator - Genymotion - Code Style for Contributors - Editorconfig Advance for a project Best practices - Best Practices for Performance - Best practices in Android development - Avoiding Memory Leak​ (​Android Memory Leak Pattern​) Best resources - Must have libraries - Android Drawables - Jake Wharton’s presentations - Awesome Android UI - Awesome Android Libraries Training Official Android Developer site is always the best ​training sites​. Followings are the must read articles of learning developing with Android. - Building Your First App - Supporting Different Devices - Managing the Activity Lifecycle - Building a Dynamic UI with Fragments
  • 13. - Best Practices for Performance