Added Alex's updated UI code.
This commit is contained in:
parent
6d545e5e7f
commit
42fbcf4e9e
25 changed files with 114 additions and 92 deletions
|
@ -1 +0,0 @@
|
|||
Capstone
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,20 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<compositeConfiguration>
|
||||
<compositeBuild compositeDefinitionSource="SCRIPT" />
|
||||
</compositeConfiguration>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -11,6 +11,7 @@
|
|||
android:label="Keyless Auto"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".VThiefPictures"></activity>
|
||||
<activity android:name=".remotecamera" />
|
||||
|
|
|
@ -9,9 +9,12 @@ import android.view.View;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
|
||||
public class About extends AppCompatActivity {
|
||||
FirebaseAuth fAuth;
|
||||
DatabaseReference reff;
|
||||
private TextView web;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -32,6 +35,11 @@ public class About extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -9,10 +9,13 @@ import android.widget.Button;
|
|||
import android.widget.ImageButton;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
|
||||
public class Apps extends AppCompatActivity {
|
||||
FirebaseAuth fAuth;
|
||||
Button remote, thief;
|
||||
DatabaseReference reff;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -38,6 +41,11 @@ public class Apps extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -168,6 +168,11 @@ public class Drivers extends AppCompatActivity{
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import android.widget.Toast;
|
|||
import com.google.android.gms.tasks.OnFailureListener;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
import com.google.firebase.storage.FirebaseStorage;
|
||||
import com.google.firebase.storage.StorageReference;
|
||||
import com.google.firebase.storage.UploadTask;
|
||||
|
@ -40,6 +42,7 @@ public class Enrollment extends AppCompatActivity {
|
|||
ImageView preview;
|
||||
Button upload;
|
||||
Uri imageUri;
|
||||
DatabaseReference reff;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -77,6 +80,11 @@ public class Enrollment extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.google.android.gms.tasks.Task;
|
|||
import com.google.firebase.auth.AuthResult;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
|
||||
public class Login extends AppCompatActivity {
|
||||
private EditText email, password;
|
||||
|
@ -28,6 +29,7 @@ public class Login extends AppCompatActivity {
|
|||
private TextView account, pass;
|
||||
FirebaseAuth fAuth;
|
||||
private String em, pw;
|
||||
DatabaseReference reff;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -15,11 +15,14 @@ import android.widget.Toast;
|
|||
import com.google.android.gms.tasks.OnFailureListener;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
|
||||
public class Password extends AppCompatActivity {
|
||||
FirebaseAuth fAuth;
|
||||
private Button reset, backb;
|
||||
private EditText email;
|
||||
DatabaseReference reff;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -57,6 +60,11 @@ public class Password extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -9,10 +9,13 @@ import android.widget.Button;
|
|||
import android.widget.EditText;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
|
||||
public class Settings extends AppCompatActivity {
|
||||
FirebaseAuth fAuth;
|
||||
private Button dri, enr, sup, pas, abu;
|
||||
DatabaseReference reff;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -64,6 +67,11 @@ public class Settings extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -7,9 +7,12 @@ import android.os.Bundle;
|
|||
import android.view.View;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
|
||||
public class Support extends AppCompatActivity {
|
||||
FirebaseAuth fAuth;
|
||||
DatabaseReference reff;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -20,6 +23,11 @@ public class Support extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ import android.widget.ImageView;
|
|||
import com.google.android.gms.tasks.OnFailureListener;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
import com.google.firebase.database.FirebaseDatabase;
|
||||
import com.google.firebase.storage.FileDownloadTask;
|
||||
import com.google.firebase.storage.FirebaseStorage;
|
||||
import com.google.firebase.storage.StorageReference;
|
||||
|
@ -32,6 +34,7 @@ public class VThiefPictures extends AppCompatActivity {
|
|||
private ImageView mImageView;
|
||||
private FirebaseStorage storage=FirebaseStorage.getInstance();
|
||||
ImageView img1, img2, img3;
|
||||
DatabaseReference reff;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -79,6 +82,11 @@ public class VThiefPictures extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -158,6 +158,11 @@ public class add extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -13,10 +13,12 @@ import androidx.appcompat.app.AlertDialog;
|
|||
import androidx.appcompat.app.AppCompatDialogFragment;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.database.DatabaseReference;
|
||||
|
||||
public class addDriver extends AppCompatDialogFragment {
|
||||
private EditText fn, ln, ph, em;
|
||||
private addDriverListener listener;
|
||||
DatabaseReference reff;
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
|
|
|
@ -109,6 +109,11 @@ public class homepage extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -8,8 +8,11 @@ import android.media.MediaPlayer;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
|
@ -18,64 +21,47 @@ import com.google.firebase.database.FirebaseDatabase;
|
|||
|
||||
public class remotecamera extends AppCompatActivity {
|
||||
FirebaseAuth fAuth;
|
||||
ProgressDialog mDialog;
|
||||
VideoView videoView;
|
||||
WebView videoView;
|
||||
ImageButton btnPlayPause;
|
||||
DatabaseReference reff;
|
||||
String videoURL = "http://llycanada.51vip.biz:15000";
|
||||
int check = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_remotecamera);
|
||||
fAuth = FirebaseAuth.getInstance();
|
||||
videoView = (VideoView)findViewById(R.id.remotecameravideo);
|
||||
videoView = (WebView) findViewById(R.id.remotecameravideo);
|
||||
btnPlayPause = (ImageButton)findViewById(R.id.btn_play_pause);
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
|
||||
btnPlayPause.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
reff.child("1").child("camera").setValue("on");
|
||||
mDialog = new ProgressDialog(remotecamera.this);
|
||||
mDialog.setMessage("Please wait...");
|
||||
mDialog.setCanceledOnTouchOutside(true);
|
||||
mDialog.show();
|
||||
|
||||
try{
|
||||
if(!videoView.isPlaying()) {
|
||||
Uri uri = Uri.parse(videoURL);
|
||||
videoView.setVideoURI(uri);
|
||||
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
btnPlayPause.setImageResource(R.drawable.ic_play);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
videoView.pause();
|
||||
btnPlayPause.setImageResource(R.drawable.ic_play);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
|
||||
if (check == 0) {
|
||||
reff.child("1").child("camera").setValue("on");
|
||||
videoView.setWebViewClient(new WebViewClient());
|
||||
videoView.loadUrl("http://lileyao1998.synology.me:15000");
|
||||
videoView.getSettings().setLoadWithOverviewMode(true);
|
||||
videoView.getSettings().setUseWideViewPort(true);
|
||||
btnPlayPause.setImageResource(R.drawable.ic_play);
|
||||
check = 1;
|
||||
} else {
|
||||
btnPlayPause.setImageResource(R.drawable.ic_pause);
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
check = 0;
|
||||
}
|
||||
videoView.requestFocus();
|
||||
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mDialog.dismiss();
|
||||
mp.setLooping(true);
|
||||
videoView.start();
|
||||
btnPlayPause.setImageResource(R.drawable.ic_pause);
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
@ -83,4 +69,5 @@ public class remotecamera extends AppCompatActivity {
|
|||
public void back(View view){
|
||||
startActivity(new Intent(getApplicationContext(), homepage.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -146,6 +146,11 @@ public class update extends AppCompatActivity {
|
|||
|
||||
public void logout(View view){
|
||||
fAuth.signOut();
|
||||
reff = FirebaseDatabase.getInstance().getReference().child("signal");
|
||||
reff.child("1").child("camera").setValue("off");
|
||||
reff.child("1").child("power").setValue("off");
|
||||
reff.child("1").child("motor").setValue("off");
|
||||
reff.child("1").child("alarm").setValue("off");
|
||||
startActivity(new Intent(getApplicationContext(), Login.class));
|
||||
finish();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
app:layout_constraintStart_toStartOf="@id/guideline"
|
||||
app:layout_constraintEnd_toEndOf="@id/guideline1" />
|
||||
|
||||
<VideoView
|
||||
<WebView
|
||||
android:id="@+id/remotecameravideo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
|||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.3'
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath 'com.google.gms:google-services:4.3.4'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
4
UI/gradle/wrapper/gradle-wrapper.properties
vendored
4
UI/gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
|||
#Wed Apr 07 11:29:30 EDT 2021
|
||||
#Thu Oct 15 10:30:57 EDT 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
## This file must *NOT* be checked into Version Control Systems,
|
||||
# as it contains information specific to your local configuration.
|
||||
#
|
||||
# Location of the SDK. This is only used by Gradle.
|
||||
# For customization when using a Version Control System, please read the
|
||||
# header note.
|
||||
#Wed Apr 07 11:25:27 EDT 2021
|
||||
sdk.dir=C\:\\Users\\batuh\\AppData\\Local\\Android\\Sdk
|
Loading…
Reference in a new issue