Android Utils

Standard

This is a utils library for Android Applications containing useful methods.
AndroidUtils class help you to interact with different parts of android os without writing many codes and as simple as possible.

Github_LogoGithub repo:
https://github.com/mirhoseini/android_utils

Grab via Maven:

<dependency>
 <groupId>com.mirhoseini.utils</groupId>
 <artifactId>utils</artifactId>
 <version>1.0.7</version>
 <type>pom</type>
</dependency>

or Gradle:

compile 'com.mirhoseini.utils:utils:1.0.7'

App Settings

Standard

This is a best practice for Android Applications Config Management using Shared Preferences.
AppSettings class help you to manage deferent types of data in your application and load them in memory for faster use also save them in shared preferences for next run.

  • Eliminate SharedPreferences and Editor Commits calls.
  • Different method ovverride to set and get all data types.
  • Allow to use different XML files for saving and accessing settings.

Github_LogoGithub repo:
https://github.com/mirhoseini/app_settings

// load saved values
 private void loadValues() {
 etName.setText(AppSettings.getString(this, KEY_NAME, ""));
 spAge.setSelection(AppSettings.getInt(this, KEY_AGE, 0));
 rbMale.setChecked(AppSettings.getBoolean(this, KEY_IS_MALE, true));
 rbFemale.setChecked(!AppSettings.getBoolean(this, KEY_IS_MALE, true));
 sbWeight.setProgress((int) (AppSettings.getFloat(this, KEY_WEIGHT, 0f) * WEIGHT_FACTOR));
 }

 // clear saved values
 private void clearValues() {
 AppSettings.clearValue(this, KEY_NAME);
 AppSettings.clearValue(this, KEY_AGE);
 AppSettings.clearValue(this, KEY_IS_MALE);
 AppSettings.clearValue(this, KEY_WEIGHT);

 loadValues();
 }

 // save input values
 private void saveValues() {
 AppSettings.setValue(this, KEY_NAME, etName.getText().toString().trim());
 AppSettings.setValue(this, KEY_AGE, spAge.getSelectedItemPosition());
 AppSettings.setValue(this, KEY_IS_MALE, rbMale.isChecked());
 AppSettings.setValue(this, KEY_WEIGHT, (float) sbWeight.getProgress() / WEIGHT_FACTOR);
 }

Grab via Maven:

<dependency>
 <groupId>com.mirhoseini.appsettings</groupId>
 <artifactId>appsettings</artifactId>
 <version>1.0.1</version>
 <type>pom</type>
</dependency>

or Gradle:

compile 'com.mirhoseini.appsettings:appsettings:1.0.1'

Tehran Traffic Map App v4.0.2 Released!

Standard

Tehran Traffic Map IconTehran Traffic Map
Category: Transportation
Version: 4.0.2
Size: 3.3 MB

Tehran Traffic Map
This Android application use your mobile internet connection (WIFI/GPRS) to show a real-time Traffic information for surface street traffic conditions within the city of Tehran. All information received from “Tehran Traffic Control Co.” cameras server and visualize on a map. It is a dual language program (Persian/English depending on device default language).
It also lets you zoom on the streets and compare new received and older map.

Screenshot_2014-04-11-16-58-02

Insulin Reminder App v1.0 Released!

Standard

Insulin Reminder
Category: Health
Version: 1.0
Size: 2 MB

Insulin Reminder
This application is an insulin reminder for diabetes people. It uses syringe with animation shown with two different types of insulins to remind the patient not to forget and shows how to fill the syringe. It also could alarm another person with SMS if the patient forgot to inject his insulin after a while.

Screenshot_2015-11-20-19-14-35

Screenshot_2015-11-20-19-15-07

Screenshot_2015-11-20-19-23-10

Tehran Traffic Map App v3.2.1 Released!

Standard


Tehran Traffic Map IconTehran Traffic Map
Category: Transportation
Version: 3.2.1
Size: 1 MB

Tehran Traffic Map
This Android application use your mobile internet connection (WIFI/GPRS) to show a real-time Traffic information for surface street traffic conditions within the city of Tehran. All information received from “Tehran Traffic Control Co.” cameras server and visualize on a map. It is a dual language program (Persian/English depending on device default language).
It also lets you zoom on the streets and compare new received and older map.

What’s new in v3.2.1:
– Added in app payment to remove ads

Screenshots:
Screenshot_2013-09-22-13-58-20

Screenshot_2013-09-22-14-08-38

 

Tehran Traffic Map App v3.1.0 Released!

Standard


Tehran Traffic Map IconTehran Traffic Map
Category: Transportation
Version: 3.1.1
Size: 992 KB

Tehran Traffic Map
This Android application use your mobile internet connection (WIFI/GPRS) to show a real-time Traffic information for surface street traffic conditions within the city of Tehran. All information received from “Tehran Traffic Control Co.” cameras server and visualize on a map. It is a dual language program (Persian/English depending on device default language).
It also lets you zoom on the streets and compare new received and older map.

What’s new in v3.1.1:
– Major changes in UI
– Adding zoom ability to Traffic map
– Adding more details to Traffic map
– Fixed Zoom bug
– Fixed File size issue

Screenshots:
Screenshot_2013-09-22-13-58-20

Screenshot_2013-09-22-14-08-38

 

Check if an Android application is installed

Standard

You can use this method or create your own method some thing like this:

public static Boolean isInstalled(Context context, String packageName) {
 final PackageManager pm = context.getPackageManager();
 // get a list of installed apps.
 List<ApplicationInfo> packages = pm
 .getInstalledApplications(PackageManager.GET_META_DATA);

 for (ApplicationInfo packageInfo : packages) {
 if (packageInfo.packageName.equals(packageName)) {
 return true;
 }
 }
 return false;
 }