All Projects → vsay01 → Android Studio Mvp Template Google Architecture

vsay01 / Android Studio Mvp Template Google Architecture

Licence: apache-2.0

Projects that are alternatives of or similar to Android Studio Mvp Template Google Architecture

Newandroidarchitecture Component Github
Sample project based on the new Android Component Architecture
Stars: ✭ 229 (+106.31%)
Mutual labels:  google, architecture
The Pit Of The Android Studio
👍 👍 👏 🌟 ⭐️ ⭐️ Everything about the Android Studio and Intellij IDEAfor example:Install,common problems and solutions,each libraries for android and androidx library,code and peoject templates,etc.全面总结Android Studio以及Intellij IDEA的填坑指南,详解AS版本号、Gradle版本、BuildTools三者的对照关系,AS模板配置,gradle插件,Android自带注解库详解,support详解等干货。
Stars: ✭ 296 (+166.67%)
Mutual labels:  freemarker, androidstudio
Villains-and-Heroes
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. ⚡
Stars: ✭ 53 (-52.25%)
Mutual labels:  architecture, mvp-architecture
Android Mvp Architecture
🏛 A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.
Stars: ✭ 203 (+82.88%)
Mutual labels:  architecture, mvp-architecture
Mvparmstemplate
🛠️ A template for Android Studio to create MVPArms and MVPArt Page
Stars: ✭ 697 (+527.93%)
Mutual labels:  freemarker, template
Mvparms Module Template
🛠 一键搭建 MVPArms 的官方架构, 让新手一秒即可开启 MVPArms 的世界, 免于项目繁琐配置的烦恼
Stars: ✭ 234 (+110.81%)
Mutual labels:  freemarker, template
Componentizationarch
Stars: ✭ 265 (+138.74%)
Mutual labels:  architecture, mvp-architecture
Offlinefirstreactiveapp Tutorial
Check out the blog post for more info
Stars: ✭ 120 (+8.11%)
Mutual labels:  architecture, mvp-architecture
Reference Architectures
templates and scripts for deploying Azure Reference Architectures
Stars: ✭ 554 (+399.1%)
Mutual labels:  architecture, template
Android Starter
[Android Architecture] Android starter based on MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Android template project.
Stars: ✭ 522 (+370.27%)
Mutual labels:  architecture, mvp-architecture
Android Clean Architecture Boilerplate
Apply clean architecture on Android
Stars: ✭ 141 (+27.03%)
Mutual labels:  architecture, mvp-architecture
Vipera
Project is now called Swift template, check the link ➡️
Stars: ✭ 57 (-48.65%)
Mutual labels:  architecture, template
Armscomponent
📦 A complete android componentization solution, powered by MVPArms (MVPArms 官方快速组件化方案).
Stars: ✭ 1,664 (+1399.1%)
Mutual labels:  architecture, mvp-architecture
Dialogflow Web
Web App for Dialogflow
Stars: ✭ 135 (+21.62%)
Mutual labels:  google, template
Moxy
Moxy is MVP library for Android
Stars: ✭ 1,611 (+1351.35%)
Mutual labels:  architecture, mvp-architecture
arch-pattern-modularization
🌵Implementation of Modularization on Architecture Pattern
Stars: ✭ 27 (-75.68%)
Mutual labels:  architecture, mvp-architecture
Mvparms
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Stars: ✭ 10,146 (+9040.54%)
Mutual labels:  architecture, mvp-architecture
Armscomponent Template
🛠️ 一键搭建 ArmsComponent 快速组件化方案的整体组件架构, 让新手也可以一秒开始组件化项目, 开发神器, 让您一秒起飞, 体验纯傻瓜式的组件化开发, 避免组件化从入门到放弃!
Stars: ✭ 339 (+205.41%)
Mutual labels:  freemarker, template
Mvpart
🎨 A new Android MVP architecture (此框架旨在解决传统 MVP 类和接口太多, 并且 Presenter 和 View 通过接口通信过于繁琐, 重用 Presenter 代价太大等问题).
Stars: ✭ 776 (+599.1%)
Mutual labels:  architecture, mvp-architecture
Simple Mvp Retrofit Example
A simple example of a project using MVP architecture and Retrofit 2.0 library for Android for beginners.
Stars: ✭ 70 (-36.94%)
Mutual labels:  mvp-architecture, template

Android-Studio-MVP-Template-Google-Architecture

Starting with Android Studio 4.1, Google ended its support for custom FreeMarker templates. :( Now you can’t just write your FTL files and put them in a template folder of Android Studio

For Android Studio 4.1: You can install this plugin write plugin as follow: https://github.com/vsay01/Android-Studio-MVP-Template-Google-Architecture-Plugin. Generate jar file and install plugin locally.

Updated

I added support for Kotlin, so there are two templates:

  • MVP Template Google Architect (Java)
  • MVP Template Google Architect (Kotlin)

If you install manually and interested in Kotlin only, you need to copy folder MVP Template Google Architect (Kotlin) otherwise if you install via the script install.sh then both template should be available for you.

One important thing to note is that you need to select source language for each template (Please refer to demo). In other word:

  • If you choose MVP Template Google Architect (Java) template → source language need to be Java
  • If you choose MVP Template Google Architect (Kotlin) template → source language need to be Kotlin

Create Kotlin MVP template

======================================================================================

This is an Android Studio template for MVP; the template is inspired by google samples/ android architecture

Important: The main goal of this template is to speed up the development process using android mvp template. This is just a template, so feel free to make changes according to your needs. It also shows how to create a set of files using template files in Android Studio. This template was successfully tested with Android 2.3.3.

Thanks to riggaroo/android-studio-group-templates-mvp and benoitletondor/Android-Studio-MVP-template for the resources allow me create my own.

Installation

For Mac:

  • If you have a standard Android Studio installation:

Just run the install script at the root of this repository:

./install.sh
  • Manual installation:

Just copy directory MVPTemplate to $ANDROID_STUDIO_FOLDER$/Contents/plugins/android/lib/templates/activities/

For Windows:

Just copy directory MVPTemplate to $ANDROID_STUDIO_FOLDER$\plugins\android\lib\templates\activities\

How to use

1. Create Base classes

The main idea of the base classes is to have common methods that share across the activities, fragments, contracts and presenters, written down in one place.

For instance: In our MVP template, all views will need to set the presenter so wrote a method, setPresenter(), in the BasePresenter so all the presenters class inherite from BasePresenter need to implement the method.

Here are the needed bases classes:

  • BaseActivity
package com.template.test.testmvptemplate; // your application package

import android.support.v7.app.AppCompatActivity;

public abstract class BaseActivity extends AppCompatActivity {
  // TODO: add any relevance methods
}
  • BaseFragment
package com.template.test.testmvptemplate; // your application package

import android.support.v4.app.Fragment;

public class BaseFragment extends Fragment {
  // TODO: add any relevance methods
}

  • BaseContract
package com.template.test.testmvptemplate; // your application package

public interface BaseContract {

  interface View<T extends Presenter> {
    void setPresenter(T presenter);
  }

  interface Presenter {
    void start();
    void stop();
  }
}
  • BasePresenter
package com.template.test.testmvptemplate; // your application package

import android.content.Context;
import android.support.annotation.NonNull;

public class BasePresenter {
  protected Context mContext;

  public void subscribe(@NonNull Context context) {
    this.mContext = context;

  public boolean isSubscribed() {
    return mContext != null;
  }
}

2. Generate MVP template

Create MVP template

3. Resolve imports and add your activities to manifest

Import classes as needed. and currently this template doesnot add the created activity to manifest.xml, so you need to manually add your activity to manifest.xlm file.

Known issue

From Riggaroo blog/ known issue for MVP template: When upgrading Android Studio, and you have custom groups of file templates in the installation area specified above, Studio will say you have conflicts in the area that need to be deleted. Unfortunately you will have to remove them, and then place them in the same folder after the upgrade. Check out this feature request here.

License

Support

If you've found an error in this sample, please file an issue to https://github.com/vsay01/Android-Studio-MVP-Template-Google-Architecture Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.

License

License

Copyright 2017 Vortana Say

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].