├── .gitignore ├── project.properties ├── res ├── raw │ ├── majed.mp3 │ └── notification.mp3 ├── drawable-hdpi │ ├── logo.png │ ├── shefrah.jpg │ ├── background.PNG │ ├── background2.png │ ├── prayerstable.png │ ├── alertbackground.PNG │ ├── praytimetext4.png │ ├── prayerstable_left.png │ ├── prayerstable_right.png │ ├── praytimebackground.png │ └── secondary_background.png ├── drawable-ldpi │ ├── bbg.png │ ├── icon.png │ ├── logo.png │ ├── shefrah.jpg │ └── background1.png ├── drawable-mdpi │ ├── bbg.png │ ├── icon.png │ ├── logo.png │ ├── shefrah.jpg │ └── background1.png ├── layout │ ├── alert.xml │ ├── cityfindermanual.xml │ ├── about.xml │ ├── cityfinder.xml │ └── main.xml ├── xml │ └── settings.xml └── values │ └── strings.xml ├── assets ├── CountriesDB └── fonts │ ├── KacstTitle.ttf │ ├── Roboto-Regular.ttf │ └── DroidNaskh-Regular.ttf ├── ReadMe ├── .settings └── org.eclipse.jdt.core.prefs ├── gen └── com │ └── shefra │ └── prayertimes │ ├── BuildConfig.java │ └── R.java ├── src └── com │ └── shefra │ └── prayertimes │ ├── manager │ ├── Country.java │ ├── City.java │ ├── PrayerState.java │ ├── CityLocationListener.java │ ├── Preference.java │ └── Manager.java │ ├── moazen │ ├── Date.java │ ├── Coordinate.java │ ├── Season.java │ ├── Mazhab.java │ ├── Calender.java │ ├── Time.java │ └── PrayerTime.java │ ├── services │ ├── PhoneStateBroadcastReceiver.java │ ├── OnBootService.java │ ├── CustomPhoneStateListener.java │ ├── PrayerService.java │ └── PrayerReceiver.java │ ├── helper │ ├── Typefaces.java │ ├── TimeHelper.java │ └── DatabaseHelper.java │ └── activity │ ├── About.java │ ├── AlertActivity.java │ ├── CityFinderManual.java │ ├── SettingsActivity.java │ ├── MainActivity.java │ └── CityFinder.java ├── lint.xml ├── .classpath ├── .project ├── proguard.cfg └── AndroidManifest.xml /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # Project target. 2 | target=android-7 3 | -------------------------------------------------------------------------------- /res/raw/majed.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/raw/majed.mp3 -------------------------------------------------------------------------------- /assets/CountriesDB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/assets/CountriesDB -------------------------------------------------------------------------------- /res/raw/notification.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/raw/notification.mp3 -------------------------------------------------------------------------------- /assets/fonts/KacstTitle.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/assets/fonts/KacstTitle.ttf -------------------------------------------------------------------------------- /res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /res/drawable-ldpi/bbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-ldpi/bbg.png -------------------------------------------------------------------------------- /res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /res/drawable-mdpi/bbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-mdpi/bbg.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /res/drawable-hdpi/shefrah.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/shefrah.jpg -------------------------------------------------------------------------------- /res/drawable-ldpi/shefrah.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-ldpi/shefrah.jpg -------------------------------------------------------------------------------- /res/drawable-mdpi/shefrah.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-mdpi/shefrah.jpg -------------------------------------------------------------------------------- /assets/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/assets/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /res/drawable-hdpi/background.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/background.PNG -------------------------------------------------------------------------------- /res/drawable-hdpi/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/background2.png -------------------------------------------------------------------------------- /res/drawable-hdpi/prayerstable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/prayerstable.png -------------------------------------------------------------------------------- /res/drawable-ldpi/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-ldpi/background1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-mdpi/background1.png -------------------------------------------------------------------------------- /assets/fonts/DroidNaskh-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/assets/fonts/DroidNaskh-Regular.ttf -------------------------------------------------------------------------------- /res/drawable-hdpi/alertbackground.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/alertbackground.PNG -------------------------------------------------------------------------------- /res/drawable-hdpi/praytimetext4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/praytimetext4.png -------------------------------------------------------------------------------- /res/drawable-hdpi/prayerstable_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/prayerstable_left.png -------------------------------------------------------------------------------- /res/drawable-hdpi/prayerstable_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/prayerstable_right.png -------------------------------------------------------------------------------- /res/drawable-hdpi/praytimebackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/praytimebackground.png -------------------------------------------------------------------------------- /res/drawable-hdpi/secondary_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shefra/prayertimes/HEAD/res/drawable-hdpi/secondary_background.png -------------------------------------------------------------------------------- /ReadMe: -------------------------------------------------------------------------------- 1 | Tomaanina is Islamic Android application helps users to know prayers times, get notification on Adhan ( prayer call) and turn the mobile into silent mode during the prayers time.It's an open source application. -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 3 | org.eclipse.jdt.core.compiler.compliance=1.5 4 | org.eclipse.jdt.core.compiler.source=1.5 5 | -------------------------------------------------------------------------------- /gen/com/shefra/prayertimes/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.shefra.prayertimes; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/manager/Country.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.manager; 2 | 3 | public class Country { 4 | public String id=null; 5 | public String name=null; 6 | 7 | public String shortName = null; 8 | public String longName = null; 9 | } 10 | -------------------------------------------------------------------------------- /lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/manager/City.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.manager; 2 | 3 | public class City { 4 | public String name = null; 5 | public String id = null; 6 | public int timeZone = -999; 7 | public String longitude; 8 | public String latitude ; 9 | public Country country; 10 | public City(){ 11 | this.country = new Country(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/moazen/Date.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package com.shefra.prayertimes.moazen; 6 | /** 7 | * 8 | * @author Admin 9 | */ 10 | public class Date { 11 | public Date(int day,int month,int year) 12 | { 13 | this.day = day; 14 | this.month = month; 15 | this.year = year; 16 | } 17 | 18 | int day; 19 | int month; 20 | int year; 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/moazen/Coordinate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package com.shefra.prayertimes.moazen; 6 | /** 7 | * 8 | * @author Admin 9 | */ 10 | public class Coordinate { 11 | public double longitude; 12 | public double latitude; 13 | public int zone; 14 | public Coordinate(){} 15 | public Coordinate(double longitude,double latitude,int zone){ 16 | this.longitude = longitude; 17 | this.latitude = latitude; 18 | this.zone = zone; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/services/PhoneStateBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.services; 2 | 3 | 4 | 5 | import android.content.BroadcastReceiver; 6 | import android.content.Context; 7 | import android.content.Intent; 8 | import android.telephony.PhoneStateListener; 9 | import android.telephony.TelephonyManager; 10 | 11 | public class PhoneStateBroadcastReceiver extends BroadcastReceiver{ 12 | 13 | @Override 14 | public void onReceive(Context context, Intent intent) { 15 | 16 | TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 17 | telephonyManager.listen(new CustomPhoneStateListener(context), PhoneStateListener.LISTEN_CALL_STATE); 18 | 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/services/OnBootService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * OnBootService Class is an: Android Service that boots with the System to run 3 | * ServiceSetAlarm so the set alarm won't be lost. 4 | */ 5 | 6 | package com.shefra.prayertimes.services; 7 | 8 | import android.content.BroadcastReceiver; 9 | import android.content.Context; 10 | import android.content.Intent; 11 | import android.util.Log; 12 | 13 | public class OnBootService extends BroadcastReceiver { 14 | 15 | public void onReceive(Context context, Intent intent) { 16 | if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { 17 | Intent serviceIntent = new Intent(context, PrayerService.class); 18 | context.startService(serviceIntent); 19 | }else{ 20 | //Log.e("OnBootService", "Received unexpected intent " + intent.toString()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | tomaanina 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/moazen/Season.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.moazen; 2 | 3 | 4 | public class Season { 5 | public enum Type { 6 | Winter, 7 | Summer 8 | } 9 | 10 | Season(){this.season=Type.Winter;} 11 | Season(Type T){this.season=T;} 12 | public void setSeason(Type season){ 13 | this.season=season; 14 | } 15 | public void setSeason(String season){ 16 | if(season.equals("Winter")) 17 | this.season=Type.Winter; 18 | else 19 | this.season=Type.Summer; 20 | 21 | } 22 | 23 | public final Type type(){return seasonInt() ;} 24 | public final Type seasonInt(){return season;} 25 | public final String seasonString(){ 26 | String tmp; 27 | if(season.equals(Type.Winter)) 28 | tmp="Winter"; 29 | else 30 | tmp = "Summer"; 31 | return tmp; 32 | } 33 | private Type season; 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/helper/Typefaces.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.helper; 2 | 3 | import java.util.Hashtable; 4 | 5 | import android.content.Context; 6 | import android.graphics.Typeface; 7 | import android.util.Log; 8 | 9 | // prevent Android bug that leads to memory leaks. 10 | // this workaround done by @HTH and @Brian. more info in : 11 | // http://code.google.com/p/android/issues/detail?id=9904 12 | public class Typefaces { 13 | private static final String TAG = "tomaanina"; 14 | 15 | private static final Hashtable cache = new Hashtable(); 16 | 17 | public static Typeface get(Context c, String assetPath) { 18 | synchronized (cache) { 19 | if (!cache.containsKey(assetPath)) { 20 | try { 21 | Typeface t = Typeface.createFromAsset(c.getAssets(), 22 | assetPath); 23 | cache.put(assetPath, t); 24 | } catch (Exception e) { 25 | //Log.e(TAG, "Could not get typeface '" + assetPath 26 | // + "' because " + e.getMessage()); 27 | return null; 28 | } 29 | } 30 | return cache.get(assetPath); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/moazen/Mazhab.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package com.shefra.prayertimes.moazen; 6 | /** 7 | * 8 | * @author aziz 9 | */ 10 | public class Mazhab { 11 | public enum Type { 12 | Default, 13 | Hanafi 14 | } 15 | 16 | Mazhab(){this.mazhab=Type.Default;} 17 | Mazhab(Type T){this.mazhab=T;} 18 | public void setMazhab(Type mazhab){ 19 | this.mazhab=mazhab; 20 | } 21 | public void setMazhab(String mazhab){ 22 | if(mazhab.equals("Default")) 23 | this.mazhab=Type.Default; 24 | else 25 | this.mazhab=Type.Hanafi; 26 | 27 | } 28 | 29 | public final Type type(){return mazhabInt() ;} 30 | public final Type mazhabInt(){return mazhab;} 31 | public final String mazhabString(){ 32 | String tmp; 33 | if(mazhab.equals(Type.Default)) 34 | tmp="Default"; 35 | else 36 | tmp = "Hanafi"; 37 | return tmp; 38 | } 39 | private Type mazhab; 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/manager/PrayerState.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.manager; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.content.SharedPreferences.Editor; 6 | import android.preference.PreferenceManager; 7 | 8 | public class PrayerState { 9 | public static final int UNKNOWN = 1000; 10 | public static final int WAITING_AZAN = 0; 11 | public static final int PRE_DOING_AZAN = 1; 12 | public static final int DOING_AZAN = 2; 13 | public static final int WAITING_PRAYER = 3; 14 | 15 | private Context context; 16 | 17 | public PrayerState(Context context) { 18 | this.context = context; 19 | setNextState(WAITING_AZAN); 20 | } 21 | 22 | public int getCurrentState() { 23 | SharedPreferences pref = PreferenceManager 24 | .getDefaultSharedPreferences(this.context); 25 | return pref.getInt("prayerState", WAITING_AZAN); 26 | } 27 | 28 | public void setNextState(int state) { 29 | SharedPreferences pref = PreferenceManager 30 | .getDefaultSharedPreferences(this.context); 31 | Editor editor = pref.edit(); 32 | editor.putInt("prayerState", state); 33 | editor.putLong("stateChangeTime", System.currentTimeMillis()); 34 | editor.commit(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembernames class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembernames class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers enum * { 30 | public static **[] values(); 31 | public static ** valueOf(java.lang.String); 32 | } 33 | 34 | -keep class * implements android.os.Parcelable { 35 | public static final android.os.Parcelable$Creator *; 36 | } 37 | -------------------------------------------------------------------------------- /src/com/shefra/prayertimes/services/CustomPhoneStateListener.java: -------------------------------------------------------------------------------- 1 | package com.shefra.prayertimes.services; 2 | 3 | import com.shefra.prayertimes.manager.Manager; 4 | 5 | import android.telephony.PhoneStateListener; 6 | 7 | import android.content.Context; 8 | import android.telephony.TelephonyManager; 9 | 10 | public class CustomPhoneStateListener extends PhoneStateListener { 11 | 12 | //private static final String TAG = "PhoneStateChanged"; 13 | Context context; //Context to make Toast if required 14 | public CustomPhoneStateListener(Context context) { 15 | super(); 16 | this.context = context; 17 | } 18 | 19 | @Override 20 | public void onCallStateChanged(int state, String incomingNumber) { 21 | super.onCallStateChanged(state, incomingNumber); 22 | 23 | switch (state) { 24 | case TelephonyManager.CALL_STATE_IDLE: 25 | //when Idle i.e no call 26 | Manager.isPhoneIdle = true; 27 | break; 28 | case TelephonyManager.CALL_STATE_OFFHOOK: 29 | //when Off hook i.e in call 30 | Manager.isPhoneIdle = false; 31 | break; 32 | case TelephonyManager.CALL_STATE_RINGING: 33 | //when Ringing 34 | Manager.isPhoneIdle = false; 35 | break; 36 | default: 37 | break; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /res/layout/alert.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /res/layout/cityfindermanual.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 23 | 24 | 31 | 32 | 38 | 39 |