SlideShare a Scribd company logo
1 of 25
Download to read offline
Version Management
@KeithYokoma - Drivemode, Inc.
potatotips #11
KeithYokoma
Keishin Yokomaku
Drivemode, Inc.
Android Engineer
GitHub: https://github.com/KeithYokoma
e-Book: http://amzn.to/1mZNydv
When your application is updated…
You may…
• Change database scheme
• Write new preferences
• Migrate to new data models
• Trigger data synchronization
• and so on…
It could happen!
int current = // get current version code from PackageManager
int previous = // read previous version from Preference
if (current <= previous) { return; }
if (previous < 1) {} // do when the app is updated from 0
if (previous < 2) {} // do when the app is updated from 0 or 1
if (previous < 3) {} // do when the app is updated from 0 ~ 2
if (previous < 4) {}
if (previous < 5) {}
if (previous < 6) {}
It could happen!
int current = // get current version code from PackageManager
int previous = // read previous version from Preference
if (current <= previous) { return; }
if (previous < 1) {} // do when the app is updated from 0
if (previous < 2) {} // do when the app is updated from 0 or 1
if (previous < 3) {} // do when the app is updated from 0 ~ 2
if (previous < 4) {}
if (previous < 5) {}
if (previous < 6) {}
Too many “if” statement!
int current = // get current version code from PackageManager
int previous = // read previous version from Preference
if (current <= previous) { return; }
if (previous < 1) {} // do when the app is updated from 0
if (previous < 2) {} // do when the app is updated from 0 or 1
if (previous < 3) {} // do when the app is updated from 0 ~ 2
if (previous < 4) {}
if (previous < 5) {}
if (previous < 6) {}
Just fit for you
https://github.com/KeithYokoma/Fit
Fit
• Annotation based
• Automatically call your procedure
• Reusable method declaration
• No more dull “if” statement
Version Module class
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Version Module class
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Version Module class
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Application class
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Fit.initialize(this, new MyModule());
Fit.getInstance().execute();
}
}
Application class
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Fit.initialize(this, new MyModule());
Fit.getInstance().execute();
}
}
Application class
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Fit.initialize(this, new MyModule());
Fit.getInstance().execute();
}
}
That’s it!
Behaviour
Version 1 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 1 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 1 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 1 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 1 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 3 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 3 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Behaviour
Version 3 to 4
public class MyModule implements VersionModule {
// foo() is called when the app is updated to
// version code = 1, 2 and 3
@VersionCode({1, 2, 3})
public void foo() {}
// bar() is called when the app is updated to version code = 4
@VersionCode(4)
public void bar() {}
}
Version Management
@KeithYokoma - Drivemode, Inc.
potatotips #11

More Related Content

Similar to Version Management

What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
Java concurrency model - The Future Task
Java concurrency model - The Future TaskJava concurrency model - The Future Task
Java concurrency model - The Future TaskSomenath Mukhopadhyay
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)Jose Manuel Pereira Garcia
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalDrupalDay
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupalsparkfabrik
 
rssfeeds.classpathrssfeeds.project rssfeed .docx
rssfeeds.classpathrssfeeds.project  rssfeed  .docxrssfeeds.classpathrssfeeds.project  rssfeed  .docx
rssfeeds.classpathrssfeeds.project rssfeed .docxjoellemurphey
 
JCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsJCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsSimon Su
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_iNico Ludwig
 
Prefixルーティングとthemeのススメ
PrefixルーティングとthemeのススメPrefixルーティングとthemeのススメ
PrefixルーティングとthemeのススメShusuke Otomo
 
Тестирование на Android с Dagger 2
Тестирование на Android с Dagger 2Тестирование на Android с Dagger 2
Тестирование на Android с Dagger 2Kirill Rozov
 
Dive into Play Framework
Dive into Play FrameworkDive into Play Framework
Dive into Play FrameworkMaher Gamal
 
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptxNew features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptxMuralidharan Deenathayalan
 
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the FlowInspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flowmhelmich
 
Vapor – Swift is not only for iOS anymore
Vapor – Swift is not only for iOS anymoreVapor – Swift is not only for iOS anymore
Vapor – Swift is not only for iOS anymoreMilan Vít
 
Oracle Concurrent Program Setup document
Oracle Concurrent Program Setup  documentOracle Concurrent Program Setup  document
Oracle Concurrent Program Setup documentvenkatesh gurusamy
 
Local SQLite Database with Node for beginners
Local SQLite Database with Node for beginnersLocal SQLite Database with Node for beginners
Local SQLite Database with Node for beginnersLaurence Svekis ✔
 
Virtual function
Virtual functionVirtual function
Virtual functionzindadili
 

Similar to Version Management (20)

What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
Java concurrency model - The Future Task
Java concurrency model - The Future TaskJava concurrency model - The Future Task
Java concurrency model - The Future Task
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
rssfeeds.classpathrssfeeds.project rssfeed .docx
rssfeeds.classpathrssfeeds.project  rssfeed  .docxrssfeeds.classpathrssfeeds.project  rssfeed  .docx
rssfeeds.classpathrssfeeds.project rssfeed .docx
 
JCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsJCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop Labs
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i
 
Prefixルーティングとthemeのススメ
PrefixルーティングとthemeのススメPrefixルーティングとthemeのススメ
Prefixルーティングとthemeのススメ
 
Тестирование на Android с Dagger 2
Тестирование на Android с Dagger 2Тестирование на Android с Dagger 2
Тестирование на Android с Dagger 2
 
Android Lab
Android LabAndroid Lab
Android Lab
 
Dive into Play Framework
Dive into Play FrameworkDive into Play Framework
Dive into Play Framework
 
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptxNew features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
New features of Minimal APIs in .NET 7 -Muralidharan Deenathayalan.pptx
 
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the FlowInspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
 
Vapor – Swift is not only for iOS anymore
Vapor – Swift is not only for iOS anymoreVapor – Swift is not only for iOS anymore
Vapor – Swift is not only for iOS anymore
 
Oracle Concurrent Program Setup document
Oracle Concurrent Program Setup  documentOracle Concurrent Program Setup  document
Oracle Concurrent Program Setup document
 
Local SQLite Database with Node for beginners
Local SQLite Database with Node for beginnersLocal SQLite Database with Node for beginners
Local SQLite Database with Node for beginners
 
Virtual function
Virtual functionVirtual function
Virtual function
 
Spring hibernate jsf_primefaces_intergration
Spring hibernate jsf_primefaces_intergrationSpring hibernate jsf_primefaces_intergration
Spring hibernate jsf_primefaces_intergration
 

More from Keishin Yokomaku

More from Keishin Yokomaku (14)

UI optimization for night
UI optimization for nightUI optimization for night
UI optimization for night
 
Popup view on Mortar
Popup view on MortarPopup view on Mortar
Popup view on Mortar
 
Regexp in Android and Java
Regexp in Android and JavaRegexp in Android and Java
Regexp in Android and Java
 
Deep Inside Android Hacks
Deep Inside Android HacksDeep Inside Android Hacks
Deep Inside Android Hacks
 
Make it compatible
Make it compatibleMake it compatible
Make it compatible
 
Signature
SignatureSignature
Signature
 
Android Media Hacks
Android Media HacksAndroid Media Hacks
Android Media Hacks
 
Null, the Abyss
Null, the AbyssNull, the Abyss
Null, the Abyss
 
?
??
?
 
Building stable and flexible libraries
Building stable and flexible librariesBuilding stable and flexible libraries
Building stable and flexible libraries
 
Typeface
TypefaceTypeface
Typeface
 
イカしたライブラリを作った話
イカしたライブラリを作った話イカしたライブラリを作った話
イカしたライブラリを作った話
 
Google I/O 2013 報告会 Android Studio と Gradle
Google I/O 2013 報告会 Android Studio と GradleGoogle I/O 2013 報告会 Android Studio と Gradle
Google I/O 2013 報告会 Android Studio と Gradle
 
自己組織化
自己組織化自己組織化
自己組織化
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Version Management

  • 1. Version Management @KeithYokoma - Drivemode, Inc. potatotips #11
  • 2. KeithYokoma Keishin Yokomaku Drivemode, Inc. Android Engineer GitHub: https://github.com/KeithYokoma e-Book: http://amzn.to/1mZNydv
  • 3. When your application is updated…
  • 4. You may… • Change database scheme • Write new preferences • Migrate to new data models • Trigger data synchronization • and so on…
  • 5. It could happen! int current = // get current version code from PackageManager int previous = // read previous version from Preference if (current <= previous) { return; } if (previous < 1) {} // do when the app is updated from 0 if (previous < 2) {} // do when the app is updated from 0 or 1 if (previous < 3) {} // do when the app is updated from 0 ~ 2 if (previous < 4) {} if (previous < 5) {} if (previous < 6) {}
  • 6. It could happen! int current = // get current version code from PackageManager int previous = // read previous version from Preference if (current <= previous) { return; } if (previous < 1) {} // do when the app is updated from 0 if (previous < 2) {} // do when the app is updated from 0 or 1 if (previous < 3) {} // do when the app is updated from 0 ~ 2 if (previous < 4) {} if (previous < 5) {} if (previous < 6) {}
  • 7. Too many “if” statement! int current = // get current version code from PackageManager int previous = // read previous version from Preference if (current <= previous) { return; } if (previous < 1) {} // do when the app is updated from 0 if (previous < 2) {} // do when the app is updated from 0 or 1 if (previous < 3) {} // do when the app is updated from 0 ~ 2 if (previous < 4) {} if (previous < 5) {} if (previous < 6) {}
  • 8. Just fit for you https://github.com/KeithYokoma/Fit
  • 9. Fit • Annotation based • Automatically call your procedure • Reusable method declaration • No more dull “if” statement
  • 10. Version Module class public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 11. Version Module class public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 12. Version Module class public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 13. Application class public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Fit.initialize(this, new MyModule()); Fit.getInstance().execute(); } }
  • 14. Application class public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Fit.initialize(this, new MyModule()); Fit.getInstance().execute(); } }
  • 15. Application class public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Fit.initialize(this, new MyModule()); Fit.getInstance().execute(); } }
  • 17. Behaviour Version 1 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 18. Behaviour Version 1 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 19. Behaviour Version 1 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 20. Behaviour Version 1 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 21. Behaviour Version 1 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 22. Behaviour Version 3 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 23. Behaviour Version 3 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 24. Behaviour Version 3 to 4 public class MyModule implements VersionModule { // foo() is called when the app is updated to // version code = 1, 2 and 3 @VersionCode({1, 2, 3}) public void foo() {} // bar() is called when the app is updated to version code = 4 @VersionCode(4) public void bar() {} }
  • 25. Version Management @KeithYokoma - Drivemode, Inc. potatotips #11