On the path of cultivation of a cool Android open source project (i.)

Source: Internet
Author: User

Write in front

In the normal development process, we often look at a lot of information, the most commonly referred to Github's open source projects. Usually on the main page of the project can see the introduction of the project and basic use, and from time to time can see the page has a lot of color tags, look cool, very professional, very forced lattice, can promote a lot of goodwill.

Objective

This article is a very long article, many of which are material pictures, it is necessary to do every detail of the author practice once. Considering that we have limited time, picking, so according to the author's practice, first published a full version, followed by a thumbnail version. But this time the thumbnail version is not good to do, so comprehensive consideration, each individual knowledge points split out, seize the focus, as far as possible to let everyone see happy.

Here's what to remind you:

Read the full version without looking at the condensed collection, the content is the same. The full version has a certain degree of coherence.
The lite version looks refreshing, so you can quickly find relevant information and steps.

Here is the priority summary below:

RELATED links:

Full version:

    • Create a high-powered Android open source project--Little white all

Thin-Set Edition:

    • Badge series 1:top Android open source project badge
    • Use of badge series 2:jitpack
    • Badge series use of 3:travis CI
    • Badge series use of 4:circle CI
    • Use of badge series 5:codecov
    • Use of badge series 6:api_level
    • Use of badge series 7:codacy
    • Badge Series 8: Create a personality badge

Total classification:

    • Badge (Shields) series article total categories

Github Address:

    • Badge Project Demo GitHub address: Https://github.com/gdky005/AndroidBadge

The text reads as follows:

Example

Let's take a look at the most popular Android open source project Mpandroidchart.

    1. Top two Blue Tags: start the two blue tags are the main contributors to the Open source project Twitter Contact, click to jump to the Twitter homepage to view the big God News.
    2. Orange Label: is a more famous foreign open source project site Android-arsenal, many open source projects will be found here, there is a detailed description of the project. Includes team members, version numbers, GitHub project basics, and more. Click will enter the Mpandroidchart Project home page, you can see a lot of want to know, do not want to know the various information.
    3. Release Blue Tags: Click to enter the more famous Jitpack.io corresponding to the Mpandroidchart page, directly get the latest version of Mpandroidchart, but also can see the previous build history. The following highlights the use of Jitpack.io.
    4. Green Tags: This is more interesting, is the current minimum version to support, Mpandroidchart the minimum version is api-8. Click to go to the Android 2.2–2.2.3 Froyo (API Level 8) detailed introduction. This feature is android-arsenal specifically designed for developers to use. The following will also be introduced.

Below we refer to these tags as badges (shields).

Top Android Open Source Project badge

We tried to search for the Android keyword in GitHub to develop an open source project with Java as the language.

The statistics are as follows:

  1. Retrofit 0
  2. Okhttp 0
  3. Butter Knife 0
  4. Mpandroidchart 4

  5. Android-universal-image-loader 2

  6. Glide 1
  7. Leakcanary 0
  8. Eventbus 1
  9. Picasso 0
  10. Zxing 3

  11. iosched 0

  12. Fresco 1

  13. Lottie-android 0

  14. Rxandroid 3
  15. LIBGDX 1
  16. Slidingmenu 0
  17. PhotoView 1
  18. Android-async-http 1
  19. Material-dialogs 5
  20. Androidutilcode 0
  21. Androidannotations 3
  22. Material-animations 1
  23. Fastjson 5
  24. Viewpagerindicator 0
  25. Plaid 0
  26. Pockethub 1
  27. Tinker 4
  28. Android-cleanarchitecture 2




We are the filter container is 30, statistics Date: April 27, 2017 (over time, may be slightly changed). There are 18 uses of the label, and there are 12 unused. The probability of use is approximately: 60%. If the scope of the filter container is a little larger, there are 12 items that do not use badges, and may not be used for historical reasons, or for personal reasons, but there will be more and more people using badges anyway.

Why use badges?

Badge shields

Badges are used not just to install B, but to make open source more efficient. Go to the project homepage to see what you need, such as whether the project compiles, what the current version is.

The badge highlights the horizon, and GitHub shows us the black and white world by default, but through the badge, it will be changed. Important information can be at a glance.

What are the most commonly used badges?

A less reliable standard, but you should know:

(PS: The order of the icons in the following order)

    1. Jitpack Badge: Jitpack is a warehouse, similar to maven,binary, primarily to help us produce an AAR or jar platform for Android projects. Based on GitHub, it is easy to publish the library to a remote location and then use Gradle to rely on any project.
    2. Travis-ci Badge: Travis-ci is a line-hosted CI service, do not need to take their own server, on the Web page a few points on the good, more convenient to use. Most importantly, it is free for open source projects.
    3. Circle-ci Badge: Cricle-ci is also a line hosting CI service, and the same, but this relatively useful, can SSH to the test container, convenient to debug in the time of the problem to find the reason, the interface is relatively good-looking.
    4. Codecov Badge: Codecov is an open source test results display platform that visualizes test results. Many open source projects on GitHub use Codecov to show the results of a single test.
    5. API Level Badge: Api-leavel is the badge shown on the Android API provided by the Android-arsenal website. You can use badge content directly from the project home page.
    6. Codacy Badge: Programming code automatic Review service platform. Help developers to find bugs in the code, improve the quality of the software, mainly including code quality, syntax, functional usability checks.
    7. Personal badges: Shiedls according to their own needs can be customized a lot of style badges, all based on personal interests, how happy how to play.
Environment description

Here I use a simple Android project to make a note, other languages are also available, here just one example.

My native Android environment is described below:

    • Mac
    • Android Studio 2.4 Preview 4
    • gradle:3.4.1
    • java:1.8.0_73
    • buildtoolsversion:25.0.2
    • Compilesdkversion:25
    • Minsdkversion:14
    • support:appcompat-v7:25.1.0
    • Constraint:constraint-layout:1.0.0-beta4
    • Classpath:com.android.tools.build:gradle:2.4.0-alpha4

It is also possible to use other versions or environments, just to illustrate. If you encounter any problems, you can leave a message in my blog.

Use of Jitpack

Official website: Https://jitpack.io

Create an Android Library

1. Create a standard Android project in as:

2. Create Library:

Configure related files

Go to Jitpack Android to see Jitpack provide us with documentation help.





Corresponding to the official website said "group= ' com.github.YourUsername '", actually can not write, write does not write will automatically generate. Even if you write something else, you end up outputting it in this format.

Androidbadge in the Build.gradle:

classpath ‘com.github.dcendents:android-maven-gradle-plugin:1.5‘ // Add this line

Androidbadge inside the Badge (library):

apply plugin: ‘com.github.dcendents.android-maven‘
Publish to Github (here directly to show the graphical operation of the interface in as, will command line of the students arbitrarily)
    1. Sign in to your GitHub account, and then create a project that you can see on the right side of the homepage:

    2. Click the Big green button and fill in the information:


      That agreement, you're casual, here's just a demo.
    3. After successful creation:


      Copies the current project address.
    4. To create a git repository in the AS Project:


      After clicking, select OK directly. Add an item to git management. The files in the project turn green: After waiting patiently, the local project has been managed by git, and then the code is submitted to GitHub. There may be conflicts and you can resolve them yourself.
    5. Now we add a tool class to the Library's badge project:


      and submit it to GitHub.
Github Play release or tag

Create the first release branch:

You can see it when the release is successful:

The general use of release can be, in the appropriate time with the tag.

Generating AAR on the Jitpack
    1. Enter the https://jitpack.io/.
    2. Copy GitHub's project address: Https://github.com/gdky005/AndroidBadge, directly to the text box in the Jitpack Web page.
    3. After you click Look up:


      After that circle inside, the green one appears:

      Stating that the AAR has been published successfully, then we can use it directly. If you open this thing, you will see the process of compiling and publishing.
    4. If it is red, it indicates an error, click View, modify and rebuild.

Test in app Demo to see if it takes effect

After clicking Get, you can see:

    1. Add the Build.gradle to the project root directory:



Androidbadge in the Build.gradle:

maven { url ‘https://jitpack.io‘ }

Androidbadge inside the app's build.gradle:

compile ‘com.github.gdky005:AndroidBadge:v1.0.0‘

OK, now we have added success, in mainactivity inside is yes, see can be transferred to the library in the previous write Utils.getversion (). I'm glad we got it:


At the bottom of the project you can see:

To run the app project:
The question is, can we call it after we modify the library?

Let's try it together:

    1. Modify the 1.0.0 in the badge project to 1.0.1:
    2. After the code is submitted, push to GitHub. After the successful submission, we repeat the above release steps
      , ,
    3. Then go to the jitpack to see:
      One more v1.0.1, click Get.
    4. After the successful release, we went to the app to try.
    5. After syncing, run the app directly. Very well, our modification of things has changed:

At this point, jitpack basically also almost, but seemingly missing the most important thing.

How do you get Jitpack's badge?

Or in just the Jitpack interface, just we pull the page down to the bottom.


After clicking:

Did you see the format of the familiar MD document? It doesn't matter if you don't understand or not, here is a special explanation.
    1. Copy content:
    2. Open GitHub's Androidbridge project:
      , click the file.
    3. Let's edit the following online:
    4. Add something to this readme.md file in GitHub.
    5. Let's keep it under.
    6. Then go back to the project homepage to see:

Awesome, add success.

On the path of cultivation of a cool Android open source project (i.)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.