Collection of source codes, utilities, templates and snippets for Android development.

Overview

Android Templates and Utilities [DEPRECATED]

Android Templates and Utilities are deprecated. I started with this project in 2012. Android ecosystem has changed a lot since then. There is a new programming language Kotlin, Android Jetpack components, RxJava and other technologies. These templates are written in Java and are not up to date.

Android Templates and Utilities is a collection of source codes, utilities, templates and snippets for Android development. It helps to build new apps and shows the best way how to implement certain things on Android platform.

I write these templates for my personal need. I use it almost every day for developing apps. It is something like cookbook for me. All my apps are based on these templates.

Note that all reusable utilities and classes have been moved to a new standalone library Alfonz. These templates use Alfonz as a dependency.

Content

In this repo you can find templates for styling app, handling activity result, working with alarm manager, animations, sending and receiving broadcasts, using dual pane layout, loading and caching images, working with intents, map, navigation drawer, showing notifications, working with parcelable, preferences, running service, setting SSL connection, timer, working with view pager, webview and much more. All templates were tested and should be compatible with Android 4.1 (API level 16).

Android Templates and Utilities are organized into 3 groups:

  • Base - basic skeleton of the Android project
  • Res - resource code including xml files, images
  • Src - source code including classes, resources

Usage

How to use these templates? Just copy a template into your project, rename package "com.example" to your own package name, rename classes' or resource's names if you want and customize the code to your needs. Some templates have /src/fragment/ExampleFragment.java class which demonstrates how to use the template in a Fragment.

Example

Example of creating a basic app skeleton with 1 Activity and 1 Fragment via Android Studio:

  • Create a new Android project with package name "com.example"
  • Copy & paste Base
  • Copy & paste Res-Placeholder
  • Copy & paste Res-Strings
  • Copy & paste Res-Theme
  • Copy & paste Src-Application-Class
  • Copy & paste Src-Config
  • Copy & paste Src-MVC-Activity
  • Copy & paste Src-MVC-Fragment
  • Add Alfonz dependencies in /mobile/build.gradle
  • Initialize Logcat utility inside ExampleApplication.onCreate(): Logcat.init(ExampleConfig.LOGS, "EXAMPLE");
  • Open ExampleActivity.java and comment out onCreateOptionsMenu(...) and onOptionsItemSelected(...) methods
  • Build the project and voilà, we have a basic MVC skeleton for our future app

Developed by

Petr Nohejl

License

Copyright 2012 Petr Nohejl

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.
You might also like...
Little utilities for more pleasant immutable data in Kotlin
Little utilities for more pleasant immutable data in Kotlin

What can KopyKat do? Mutable copy Nested mutation Nested collections Mapping copyMap copy for sealed hierarchies copy from supertypes copy for type al

A helper library to ease the most repetitive codes with simple reusable attributes.

ak-universal-android-helper A helper library to ease the most repetitive codes with simple reusable attributes. AKUAH can help you with many repetitiv

A collection of Android build scripts for various third-party libraries and the tooling to build them

ndkports A collection of Android build scripts for various third-party libraries and the tooling to build them. If you're an Android app developer loo

A collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android.

requireKTX is a collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android, using the same idea as requireContext, requireArguments, and other similar Android SDK methods.

A beautiful set of predefined colors and a set of color methods to make your Android development life easier.
A beautiful set of predefined colors and a set of color methods to make your Android development life easier.

Colours is a port of the Colours Library for iOS made by my good friend Ben Gordon. You can find that project here. Installation Maven Central Colours

Speed up your Android development

Caffeine Speed up your Android development! A collection of utility classes that help make Android development faster (and safer!) Examples No more un

KDoctor - A command-line tool that helps to set up the environment for Kotlin Multiplatform Mobile app development

KDoctor is a command-line tool that helps to set up the environment for Kotlin Multiplatform Mobile app development.

KmmCaching - An application that illustrates fetching data from remote data source and caching it in local storage
KmmCaching - An application that illustrates fetching data from remote data source and caching it in local storage

An application that illustrates fetching data from remote data source and caching it in local storage for both IOS and Android platforms using Kotlin Multiplatform Mobile and SqlDelight.

gRPC and protocol buffers for Android, Kotlin, and Java.

Wire “A man got to have a code!” - Omar Little See the project website for documentation and APIs. As our teams and programs grow, the variety and vol

Comments
  • Non-translatable string in strings.xml is missing the appropriate attribute

    Non-translatable string in strings.xml is missing the appropriate attribute

    Just saw the strings.xml and wanted to point out that for any non-translatable string, you should add translatable="false".

    For example:

    <string name="app_name"  translatable="false">Example</string>
    

    More about Non-translatable Strings.

    opened by SufianBabri 3
  • Discussion: Android Native Frameworks & Tools Review

    Discussion: Android Native Frameworks & Tools Review

    This is not an issue. I apologize for using this medium but GitHub doesn't leave much choice for communication. Please feel free to close the issue at any time

    I did a small research on the current Android RAD tools and frameworks. I included your project and I felt it's only fair to inform you and all the other projects generous developers of it: http://andyonwheels.github.io/Android-Native-Frameworks-Review/

    I hope that you see benefit from looking at what others are doing and such. If you have any feedback please do let me know.

    I'm also trying to gauge the interest of the community in having/building something on a bigger scale. Not sure what that should be so I built ~~an app~~ a survey for it. I hope experienced Android devs such as yourself would take a look at. Thank you.

    opened by SandNerd 1
Owner
Petr Nohejl
Android Platform Lead at @strvcom
Petr Nohejl
Various useful utilities for Android apps development

Android Commons Various useful utilities for Android apps development. API documentation provided as Javadoc. Usage Add dependency to your build.gradl

Alex Vasilkov 112 Nov 14, 2022
General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Markus Junginger 1.4k Dec 29, 2022
General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Markus Junginger 1.4k Dec 29, 2022
A collection of Android libraries for simplifying development

Andromeda A collection of Android libraries for simplifying development Usage Andromeda uses Jitpack for distribution, the following gradle dependency

Kyle Corry 11 Dec 6, 2022
CreditCardHelper 🖊️ A Jetpack-Compose library providing useful credit card utilities such as card type recognition and TextField ViewTransformations

CreditCardHelper ??️ A Jetpack-Compose library providing useful credit card utilities such as card type recognition and TextField ViewTransformations

Stelios Papamichail 18 Dec 19, 2022
Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Shahid Iqbal 4 Nov 29, 2022
Utilities I wish Android had but doesn't

wishlist Library of helpers and utilities that I wish were included in the Android SDK but aren't. If you think something in this library is already h

Kevin Sawicki 386 Nov 21, 2022
Android library that regroup bunch of dateTime utilities

DateTimeUtils This library is a package of functions that let you manipulate objects and or java date string. it combine the most common functions use

Thunder413 98 Nov 16, 2022
A Telegram bot utilities that help to reduce the code amount

Flume Party A Telegram bot utilities that help to reduce code amount. Real project examples Pull Party Bot: 19% of code has been reduced. Resistance B

pool party 1 Jun 8, 2022