-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
203 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
AndroidHack/app/src/main/java/com/example/alihasan/androidhack/GearActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.example.alihasan.androidhack; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
public class GearActivity extends AppCompatActivity { | ||
|
||
TextView timeView; | ||
TextView phoneView; | ||
|
||
ImageView gearIcon; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_gear); | ||
|
||
timeView = findViewById(R.id.timeView); | ||
phoneView = findViewById(R.id.phoneView); | ||
|
||
gearIcon = findViewById(R.id.gearIcon); | ||
|
||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 24 additions & 4 deletions
28
AndroidHack/app/src/main/java/com/example/alihasan/androidhack/SharedPrefClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
package com.example.alihasan.androidhack; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
|
||
public class SharedPrefClass { | ||
|
||
Context context; | ||
String timings; | ||
String mobile; | ||
|
||
public SharedPrefClass(Context context1, String timings1){ | ||
public SharedPrefClass(Context context1){ | ||
|
||
context = context1; | ||
timings = timings1; | ||
// mobile = mobile1; | ||
|
||
} | ||
|
||
public void saveMobile(String code, String mobile1){ | ||
|
||
mobile = mobile1; | ||
|
||
} | ||
SharedPreferences sharedPref = context.getSharedPreferences("mobile", Context.MODE_PRIVATE); | ||
SharedPreferences.Editor editor = sharedPref.edit(); | ||
editor.putString(code, mobile); | ||
editor.commit(); | ||
} | ||
|
||
public String getMobile(String code){ | ||
|
||
SharedPreferences sharedPref = context.getSharedPreferences("mobile", Context.MODE_PRIVATE); | ||
String timingValue = sharedPref.getString(code, "-1"); | ||
|
||
return timingValue; | ||
} | ||
|
||
|
||
|
||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".GearActivity"> | ||
|
||
<TextView | ||
android:id="@+id/timeView" | ||
android:hint="Time" | ||
android:textSize="30sp" | ||
android:lines="4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
|
||
<ImageView | ||
android:id="@+id/gearIcon" | ||
android:layout_width="150dp" | ||
android:layout_height="150dp" | ||
android:src="@drawable/ic_action_name" | ||
android:onClick="gearClicked"/> | ||
|
||
<TextView | ||
android:id="@+id/phoneView" | ||
android:hint="Phone" | ||
android:textSize="30sp" | ||
android:lines="4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters