Skip to content

Android studioでアプリ開発をしてGitHubにあげる時にあると便利かなってTemplateを備忘録的な感じで置いておきます

Notifications You must be signed in to change notification settings

blue928sky/AndroidStudioTemplates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Android studio templates

Android studioのプロジェクトファイルをGithubにあげる時によく使用するファイルを備忘録的にあげておきます

テンプレート

READ.md

README.md
README.mdのテンプレート
Google play storeのURLとアプリ名、簡単な説明、詳細説明を記入

## Google Play Store
https://play.google.com/store/apps/details?id={package id}

## アプリ名

## 簡単な説明

## 詳しい説明

README.md.vm

README.md.vm
(.vmで保存する必要はない)
Android studioにはApache VelocityでNew fileできるのでそれも作成

  • 設定場所は[Settings] > [Editor] > [File and Code Templates]から+で作れる
  • NameREADMEExtensionmdFile nameREADMEにすればREADME.mdを勝手に生成してくれる
  • 使用方法は追加したいフォルダ(大体はプロジェクトフォルダ)を右クリック[new] > [README]で自動生成してくれる
    • Package nameに問題がある場合は適宜変更
  • ※Reformat according to styleのチェックを外さないと2行目がずれる
    reference
#[[##]]# Google Play Store
https://play.google.com/store/apps/details?id=com.sample.${PROJECT_NAME.toLowerCase()}
# id以降は自身の環境に合わせて

#[[##]]# アプリ名

#[[##]]# 簡単な説明

#[[##]]# 詳しい説明

.commit_template

.commit_template
GitHubのコミットメッセージのテンプレート
ファイル名は何でもいい

# ==== Emojis ====
# 🐛 :bug:           fix: バグ修正
# 🔧 :wrench:        modify: 機能改善
# :recycle:       refactor: リファクタリング
# 📝 :memo:          docs: ドキュメント変更
# 🎨 :art:           style: フォーマットや構造改善
# 🔥 :fire:          remove: 不要な機能・ファイルの削除
# :sparkles:      feat: 部分的な機能追加
# 🍰 :cake:          chore: 自動生成されたファイル
# 🌱 :seedling:      init commit: 初期コミット
# 🧪 :test_tube:     test: テストやCIの修正・改善
# 👕 :shirt:         lint: Lintエラーの修正やコードスタイルの修正
# 🚀️ :rocket:        perf: パフォーマンス改善
# 🆙 :up:            update: 依存パッケージなどのアップデート
# 🚧 :construction:  wip: 作業中


# ==== Format ====
# :emoji:prefix: Subject
#
# Commit body...

Android studioでは

$git config commit.template {file name}

ってやっても出てこない(vimとかには出てくるけど、VCSのコミットダイアログには反映されない)のでPluginsでGit Commit Message Helperを追加して、コミットコメントを登録している

  • 登録の仕方は[Settings] > [Other Settings] > [GitCommitMessageHelper]からできる
  • Templateも設定できるからそこはお好きなように
  • 一括登録とかできたり、別の端末で同じ操作をしたい時は少し不便かなって感じがする……
  • あと、何故かdescriptionの絵文字がちょこちょこ消える

絵文字だけ使いたい人はGit Commit Guideとかあるし、地味にこのPrefixに使うのオススメって出してくれるから使いやすい
テンプレート登録とかはない

.gitignore

.gitignore
基本はAndroid studioが自動生成する物とか.jksファイル、google-services.jsonをはじく
念のため.aabも弾いてる
.idea/は正直なくても何とかなるよなって気がするけど、どっちでもいいかって意味で細かくははじいてない

# 自動生成
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

# built application files
*.apk
*.ap_
*.aab

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Ignore gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
# local.properties

# Proguard folder generated by Eclipse
proguard/

# Eclipse Metadata
.metadata/

# Mac OS X clutter
*.DS_Store

# Windows clutter
Thumbs.db

# Intellij IDEA (see https://intellij-support.jetbrains.com/entries/23393067)
.idea/workspace.xml
.idea/tasks.xml
.idea/datasources.xml
.idea/dataSources.ids

# 追加
google-services.json
*.jks

おまけ(テンプレートじゃないけど)

proguard-rules.pro

proguard-rules.pro
難読化すると問題がある場合app/にproguard-rules.proを設置してapp/build.gradle

# {flavor} は release とか debug とかビルドタイプを記入
android {
  buildTypes {
    {flavor} {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      
      # shrinkResourcesは重複リソースを結合してくれる
      shrinkResources true
    }
  }
}

を記載する必要あり

# Gson使っている場合
# dataクラスをJson変換するとおかしくなるため
-keepnames class com.sample.path.* { *; }

# Firebase Crashlytics使ってる場合
# consoleで行数やクラス名が難読化のままで見づらいため
-keepattributes SourceFile,LineNumberTable

About

Android studioでアプリ開発をしてGitHubにあげる時にあると便利かなってTemplateを備忘録的な感じで置いておきます

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy