• Stars
    star
    1,103
  • Rank 40,660 (Top 0.9 %)
  • Language
    Java
  • Created over 12 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

android-cheatsheet-for-graphic-designers

This simple cheatsheet should help graphic designers to do their job better, and to simplify developers' lives.
HTML
274
star
2

alfonz

Mr. Alfonz is here to help you build your Android app, make the development process easier and avoid boilerplate code.
Java
96
star
3

android-stocks

Experimental Android app with MVVM architecture. Purpose of this project is to explore different architectural approaches.
Java
64
star
4

android-scripts

Batch scripts for signing and getting cert keys on Windows.
Shell
26
star
5

java

Notes about Java.
7
star
6

non-realistic-video-effects

Comic, painterly and mosaic video effects in OpenCV.
C++
6
star
7

expenses

Helps to organize personal expenses.
Python
6
star
8

zitkino-android

Mobile calendar of cinemas in Brno for Android.
Java
6
star
9

invest-portfolio-template

Stocks portfolio tracker based on Google Sheets
JavaScript
5
star
10

sensor-analyzer

Testing sensors on Android devices.
Java
5
star
11

dns-server

A simple DNS server for Linux.
C++
5
star
12

date-time-picker

Date & time popup dialog.
JavaScript
4
star
13

web-scanner

Read, parse and save web page. Useful for keeping web page history.
Python
3
star
14

vypisky

Collection of study materials (cheatsheets) focused on IT. All in Czech.
3
star
15

arduino-epaper-display

Smart display IoT device based on Arduino and E-Paper display
C++
2
star
16

renamer

Multi-renaming files and directories.
Python
2
star
17

sms-reminder

Event notification by mobile phone.
Python
2
star
18

gpx-2-wpt

Convertor from GPX Pocket Query format to WPT for Ozi Explorer.
Python
2
star
19

fut

Smartphone protection from being stolen or lost.
Java
2
star
20

backup

Backup data using WinRAR.
Python
2
star
21

unix-scripts

Collection of useful bash scripts.
Shell
2
star
22

blog

My personal blog.
Python
2
star
23

jestrabot

IRC bot.
Python
1
star
24

twister

Spinner for party social game Twister.
Python
1
star
25

mimesis

Augmented reality interactive application presented on Designblok 2010.
C
1
star
26

trbot3

Script for automatic control of one certain online game.
Python
1
star
27

payment

Payment calculator according to hours worked.
Python
1
star
28

cpp-stats

Statistics of C/C++ source codes.
Python
1
star
29

razor

Automatic image cropping. Useful for images with white or black edges.
Python
1
star
30

kulkul

Logic game for mobile J2ME in 3D.
Java
1
star
31

game-levels

Few custom levels of the games Warcraft 3, Duke Nukem 3D, Elasto Mania.
1
star
32

geo-navigator

GPS navigation focused on outdoor game Geocaching.
C#
1
star
33

video-motion-analysis

Differential method and local binary patterns.
C++
1
star
34

football-cheater

Cheat program for word-football game on server hry.cz.
Python
1
star
35

napojovy-automat

Simulator machine for beverages.
Java
1
star
36

mas-na-to

Social quiz game.
C#
1
star
37

darts

3D game for PC.
C
1
star