Skip to content

Commit fee5bdc

Browse files
author
hussienalrubaye
committed
alarm
1 parent 259dddd commit fee5bdc

37 files changed

+789
-0
lines changed

Alaram App/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild

Alaram App/.idea/compiler.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/.idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/.idea/misc.xml

+49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/.idea/modules.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Alaram App/app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

Alaram App/app/build.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.3"
6+
defaultConfig {
7+
applicationId "com.alrubaye.alaram"
8+
minSdkVersion 15
9+
targetSdkVersion 24
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25+
exclude group: 'com.android.support', module: 'support-annotations'
26+
})
27+
compile 'com.android.support:appcompat-v7:24.2.1'
28+
testCompile 'junit:junit:4.12'
29+
compile 'com.frosquivel:magicaltakephoto:1.0'
30+
}

Alaram App/app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/hussienalrubaye/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.alrubaye.alaram;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.alrubaye.alaram", appContext.getPackageName());
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.alrubaye.alaram">
4+
5+
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
6+
<application
7+
android:allowBackup="true"
8+
android:icon="@mipmap/ic_launcher"
9+
android:label="@string/app_name"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
20+
<receiver
21+
android:name=".MyReceiver"
22+
android:enabled="true"
23+
android:exported="false">
24+
<intent-filter>
25+
<action android:name="com.alraby.alam"/>
26+
<action android:name="android.intent.action.BOOT_COMPLETED" />
27+
<category android:name="android.intent.category.DEFAULT"/>
28+
</intent-filter>
29+
</receiver>
30+
</application>
31+
32+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.alrubaye.alaram;
2+
3+
import android.app.AlarmManager;
4+
import android.app.PendingIntent;
5+
import android.content.Context;
6+
import android.content.Intent;
7+
import android.support.v7.app.AppCompatActivity;
8+
import android.os.Bundle;
9+
10+
import java.util.Calendar;
11+
12+
public class MainActivity extends AppCompatActivity {
13+
14+
@Override
15+
protected void onCreate(Bundle savedInstanceState) {
16+
super.onCreate(savedInstanceState);
17+
setContentView(R.layout.activity_main);
18+
android.app.FragmentManager fm= getFragmentManager();
19+
PopTime popTime=new PopTime();
20+
popTime.show(fm,"Show fragment");
21+
}
22+
23+
void SetTime(int Hour ,int Minute ){
24+
25+
26+
// /save dat
27+
savedata savedata =new savedata(this);
28+
savedata.Alarmset(Hour,Minute);
29+
savedata.SaveData(Hour,Minute);
30+
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.alrubaye.alaram;
2+
3+
import android.content.BroadcastReceiver;
4+
import android.content.Context;
5+
import android.content.Intent;
6+
import android.os.Bundle;
7+
import android.widget.Toast;
8+
9+
public class MyReceiver extends BroadcastReceiver {
10+
public MyReceiver() {
11+
}
12+
13+
@Override
14+
public void onReceive(Context context, Intent intent) {
15+
16+
if (intent.getAction().equalsIgnoreCase("com.alraby.alam")){
17+
Bundle b=intent.getExtras();
18+
Toast.makeText(context,b.getString("MyMessage"),Toast.LENGTH_LONG).show();
19+
}
20+
else if (intent.getAction().equalsIgnoreCase("android.intent.action.BOOT_COMPLETED")){
21+
// restart
22+
savedata savedata =new savedata(context);
23+
savedata.LoadData();
24+
25+
26+
}
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.alrubaye.alaram;
2+
3+
/**
4+
* Created by hussienalrubaye on 10/31/16.
5+
*/
6+
7+
import android.app.DialogFragment;
8+
import android.os.Build;
9+
import android.os.Bundle;
10+
import android.view.LayoutInflater;
11+
import android.view.View;
12+
import android.view.ViewGroup;
13+
import android.widget.Button;
14+
import android.widget.TimePicker;
15+
16+
/**
17+
* Created by hussienalrubaye on 10/9/16.
18+
*/
19+
20+
public class PopTime extends DialogFragment implements View.OnClickListener {
21+
22+
View view;
23+
TimePicker tp;
24+
Button buDome;
25+
@Override
26+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
27+
Bundle savedInstanceState)
28+
{
29+
view=inflater.inflate(R.layout.pop_time,container,false);
30+
tp=(TimePicker)view.findViewById(R.id.tp1);
31+
buDome=(Button)view.findViewById(R.id.buDome);
32+
buDome.setOnClickListener(this);
33+
return view;
34+
}
35+
36+
37+
@Override
38+
public void onClick(View v) {
39+
this.dismiss();
40+
MainActivity ma=(MainActivity)getActivity();
41+
if ((int) Build.VERSION.SDK_INT >= 23)
42+
ma.SetTime(tp.getHour(),tp.getMinute());
43+
else
44+
ma.SetTime(tp.getCurrentHour(),tp.getCurrentMinute());
45+
}
46+
}

0 commit comments

Comments
 (0)