This file contains hidden or 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
| <script type="text/javascript"> | |
| setInterval("my_function('2020-04-17T18:30:00Z');",1000); | |
| function my_function(time){ | |
| var future = Date.parse(time)/1000; | |
| var now = Date.now()/1000; | |
| var totalRem = future - now; | |
| var days = Math.floor(totalRem/86400); | |
| var hours = Math.floor((totalRem%86400)/3600); | |
| var minutes = Math.floor(((totalRem%86400)%3600)/60); |
This file contains hidden or 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
| FloatingActionButton fab = findViewById(R.id.fab); | |
| fab.setOnClickListener(new View.OnClickListener() { | |
| @Override | |
| public void onClick(View view) { | |
| //todo | |
| } | |
| }); |
This file contains hidden or 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
| package com.myapp.emergency; | |
| import android.content.Intent; | |
| import android.net.Uri; | |
| import android.os.Bundle; | |
| import android.os.Environment; | |
| import android.provider.MediaStore; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.ProgressBar; |
This file contains hidden or 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
| <uses-permission android:name="android.permission.CAMERA"/> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
| <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | |
| <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> | |
| <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
| <uses-permission android:name="com.android.email.permission.READ_ATTACHMENT"/> | |
| **Note** : Enable All Permissions Manually From App Settings. |
This file contains hidden or 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
| package net.smallacademy.songslist; | |
| import android.content.Context; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.ImageView; | |
| import android.widget.TextView; | |
| import android.widget.Toast; |
This file contains hidden or 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
| package net.smallacademy.gridcycle; | |
| import android.content.Context; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.ImageView; | |
| import android.widget.TextView; | |
| import android.widget.Toast; |
This file contains hidden or 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
| AlertDialog.Builder extraInfo = new AlertDialog.Builder(this); | |
| extraInfo.setTitle("Storage Permission is Required."); | |
| extraInfo.setMessage("To Run this app, App needs access to storage to save the file."); | |
| extraInfo.setPositiveButton("OK", new DialogInterface.OnClickListener() { | |
| @Override | |
| public void onClick(DialogInterface dialog, int which) { | |
| ActivityCompat.requestPermissions(MainActivity.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},103); | |
| } | |
| }); |
This file contains hidden or 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
| private void uploadImageToFirebase(String name, Uri contentUri) { | |
| final StorageReference image = storageReference.child("pictures/" + name); | |
| image.putFile(contentUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { | |
| @Override | |
| public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { | |
| image.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { | |
| @Override | |
| public void onSuccess(Uri uri) { | |
| Log.d("tag", "onSuccess: Uploaded Image URl is " + uri.toString()); |
This file contains hidden or 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
| package net.smallacademy.cameraandgallery; | |
| import androidx.annotation.NonNull; | |
| import androidx.annotation.Nullable; | |
| import androidx.appcompat.app.AppCompatActivity; | |
| import androidx.core.app.ActivityCompat; | |
| import androidx.core.content.ContextCompat; | |
| import androidx.core.content.FileProvider; | |
| import android.Manifest; |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <androidx.constraintlayout.widget.ConstraintLayout 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:background="#4CAF50" | |
| tools:context=".Register"> | |
| <TextView |