Skip to content

Commit 41779c6

Browse files
committed
updated post on jumpstart
1 parent 0ea618e commit 41779c6

File tree

2 files changed

+44
-56
lines changed

2 files changed

+44
-56
lines changed

_layouts/post.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ <h2 class="page-description">
6060

6161
<!-- <h1 class="post-title">{{ page.title }}</h1> -->
6262

63+
<br />
64+
6365
<section class="post-content">
6466
{{content}}
6567
</section>
Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
11
---
22
layout: post
33
title: "Jumpstarting Android Projects"
4-
date: 2017-08-30 08:00:00
4+
date: 2017-09-28 05:00:00
55
author: anuj
66
categories: Technical Android
77
---
88

9-
Starting a new Android project means writing a lot of boilerplate code, setting up your dependencies, setting up networking, dependency injection and a myriad of other small things before you can even get started on the actual app. In the spirit of DRY, we have created an automated process at moldedbits to jumpstart Android projects and get started quickly. And in the spirit of open source, we are putting this out in the public domain.
9+
Do you remember the last time you setup an Android project? How long did it take you after creating a new android project from Android Studio to customize and scaffold it before you could write the first business logic? Did you remember to setup the
1010

11-
In this post, we will demo setting up an application with the dependencies, networking and dependency injection setup and the login implemented with [Argus](https://github.com/moldedbits/argus-android).
11+
* dependencies correctly,
12+
* networking,
13+
* dependency injection,
14+
* base classes,
15+
* build types,
16+
* version number auto increment and
17+
* a million other small things?
1218

13-
#### Setting up
19+
And then to do it for every new project you start, that is hours and hours of wasted effort.
1420

15-
We have a python script to help with the initial setup. You can clone this [repo](https://github.com/moldedbits/JumpstartScript) on your machine and navigate to the folder on a terminal.
21+
<img src="https://media.giphy.com/media/l46CbAuxFk2Cz0s2A/giphy.gif" />
22+
23+
Well, not any more.
24+
25+
In the spirit of DRY, we have created an automated process at moldedbits to jumpstart Android projects and get started quickly. And in the spirit of open source, we are putting this out in the public domain.
26+
27+
Enough talk, lets code. We will demonstrate setting up an application with the dependencies, networking and dependency injection setup and the login implemented with [Argus](https://github.com/moldedbits/argus-android), all within 5 minutes.
28+
29+
<img src="https://media.giphy.com/media/6kvVGhp7bp2WA/giphy.gif" />
1630

17-
Next, to setup the project, all you need to do is run
31+
#### Step 1 - Setting up the base project
32+
33+
*Time Required: 3 minutes*
34+
35+
We have a python script to help with the initial setup. You can clone this [repo](https://github.com/moldedbits/JumpstartScript) on your machine and navigate to the folder on a terminal.
1836

1937
```
38+
$ git clone https://github.com/moldedbits/JumpstartScript
39+
$ cd JumpstartScript
2040
$ python android-jumpstart.py
2141
```
22-
This will clone the repository [android-jumpstart](https://github.com/moldedbits/android-jumpstart) locally and then ask you a few questions to customize it.
42+
43+
This will clone the repository [android-jumpstart](https://github.com/moldedbits/android-jumpstart) locally and then ask you two to customize it.
2344

2445
```
2546
...
@@ -30,18 +51,11 @@ Enter new app package: com.moldedbits.jump
3051
```
3152
This will create a project for you in the folder _JumpDemo_ that is all set to be imported into Android Studio.
3253

33-
```
34-
$ cd JumpDemo
35-
$ ls
36-
README.md buildSrc gradle.properties jumpstart.keystore
37-
app config gradlew settings.gradle
38-
build.gradle gradle gradlew.bat version.properties
39-
```
40-
With this we can import the project into Android Studio
54+
__Voila, our base project all setup. Now fire up your Android Studio, import the project and start writing business logic.__
4155

42-
<img src="/assets/images/android-studio-import.png" alt="Studio Import" style="width: 350px; margin:auto;"/>
56+
<img src="https://media.giphy.com/media/XreQmk7ETCak0/giphy.gif" />
4357

44-
This is our base project all setup. Some of the features already implemented by this are,
58+
Some of the features already implemented by this are,
4559

4660
* Dependency injection with Dagger 2
4761
* Networking with Retrofit
@@ -50,54 +64,26 @@ This is our base project all setup. Some of the features already implemented by
5064

5165
A detailed and updated list of the features is available on the [project page](https://github.com/moldedbits/android-jumpstart).
5266

53-
#### Adding login
67+
#### Step 2 - Adding login (Optional)
5468

55-
Most apps require a login flow with email, phone and social logins. To further automate this, we have created another library to make our lives easier, [Argus](https://github.com/moldedbits/argus-android). Including this is really simple. The first thing we have to do is to include Argus as a dependency in our app level build.gradle.
69+
*Time Required: 2 minutes*
5670

57-
```
58-
compile 'com.moldedbits.argus:argus:0.2.0'
59-
```
60-
Next, we modify the class BaseApplication to configure Argus.
71+
Most apps require a login flow with email, phone and social logins. To further automate this, we have created another library to make our lives easier, [Argus](https://github.com/moldedbits/argus-android). Including this is really simple. Follow the steps [here][argus-post] and you will have your login screen in less than two minutes.
6172

62-
```java
63-
// initialize Argus
64-
ArrayList<BaseProvider> loginProviders = new ArrayList<>();
73+
And that is all. With this, we have setup an app with all the dependencies and scaffolding setup to get the developer started straight on the business logic of the app, and a basic login framework.
6574

66-
loginProviders.add(new EmailLoginProvider() {
67-
@Override
68-
protected void doServerLogin(String username, String password) {
75+
<img src="https://raw.githubusercontent.com/moldedbits/argus-android/master/images/ArgusLogin.png" alt="Demo Login" style="width: 300px; margin:auto;"/>
6976

70-
}
71-
});
77+
And all of it took less than 5 minutes!
7278

73-
ArgusTheme.Builder themeBuilder = new ArgusTheme.Builder();
74-
themeBuilder.logo(R.mipmap.ic_launcher);
79+
<img src="https://media.giphy.com/media/5wWf7GW1AzV6pF3MaVW/giphy.gif" />
7580

76-
new Argus.Builder()
77-
.argusStorage(new DefaultArgusStorage(getApplicationContext()))
78-
.nextScreenProvider(new SimpleNextScreenProvider(ExampleAppActivity.class))
79-
.loginProviders(loginProviders)
80-
.theme(themeBuilder.build())
81-
.build();
82-
```
83-
And finally, we add the Argus activity to AndroidManifest.xml
84-
85-
```xml
86-
<activity
87-
android:name="com.moldedbits.argus.ArgusActivity"
88-
android:label="@string/app_name"
89-
android:screenOrientation="portrait"
90-
android:theme="@style/AppTheme">
91-
<intent-filter>
92-
<action android:name="android.intent.action.MAIN"/>
93-
<category android:name="android.intent.category.LAUNCHER"/>
94-
</intent-filter>
95-
</activity>
96-
```
97-
And that is all. With this, we have setup an app with all the dependencies and scaffolding setup to get the developer started straight on the business logic of the app, and a basic login framework.
81+
The jumpstart is, by design, very opinionated about how android apps should be written. You can pick the things you like and change / delete the things you do differently.
9882

99-
<img src="/assets/images/jump-demo-login.png" alt="Demo Login" style="width: 300px; margin:auto;"/>
83+
We will continue working on the jumpstart project to keep it updated, so you can expect to see some changes in the future. As always, if you find anything that can be improved, we welcome you to create a github issue or better to create a pull request.
10084

10185
Happy coding!
10286

10387
The moldedbits Team
88+
89+
[argus-post]: http://eng.moldedbits.com/technical/android/2017/06/26/introducing-argus.html

0 commit comments

Comments
 (0)