Aplikasi Pencarian Seminar Berbasis Android

1
LAMPIRAN PROGRAM

SplashScreen.java
package com.example.alwi.iseminar;
import
import
import
import
import

android.content.Intent;
android.os.Handler;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.Window;

public class SplashScreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_splash_screen);
/*handler untuk menahan activity sementara*/
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
/*mulai activity ke MainActivity setelah 5 detik*/
startActivity(new
Intent(getApplicationContext(),Menu.class));
finish();
}
/*durasi 5000ms*/
},5000);
}
}

Activity_Splash_Screen.xml








Menu.java
package com.example.alwi.iseminar;
import
import
import
import
import
import
import

android.content.Intent;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.View;
android.view.Window;

android.widget.Button;
android.widget.ImageButton;

public class Menu extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_menu);
//menginisiasi dan memanggil widget button pada file layout
ImageButton btn1 =(ImageButton)findViewById(R.id.button1);
ImageButton btn2 =(ImageButton)findViewById(R.id.button2);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent pindah = new Intent(Menu.this,List.class);
startActivity(pindah);
//menghubungkan antar activity dengan intent
}

});

Universitas Sumatera Utara

3

btn2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent pindah = new Intent(Menu.this,Register.class);
startActivity(pindah);
}
});
}
}

Activity Menu.xml










Register.java
package com.example.alwi.iseminar;
import
import
import
import
import
import
import

android.app.ProgressDialog;
android.content.Intent;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;

android.widget.Button;
android.widget.TextView;
android.view.View;

import com.androidquery.callback.AjaxCallback;
import com.androidquery.callback.AjaxStatus;
import com.rengwuxian.materialedittext.MaterialEditText;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class Register extends BaseApp {
private MaterialEditText regtxtEmail, regtxtPassword1,
regtxtPassword2,regtxtPhone1;
private TextView reglblLogin;
private Button regbtnRegister;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);

setupView();
reglblLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
view.startAnimation(BtnAnimasi);

Universitas Sumatera Utara

5
startActivity(new Intent(context, Login.class));
}
});
regbtnRegister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
registerUser();
}
});
}
private void registerUser() {

regtxtEmail.setError(null);
regtxtPassword1.setError(null);
regtxtPassword2.setError(null);
regtxtPhone1.setError(null);
if (Helper.isEmpty(regtxtEmail)) {
regtxtEmail.setError("Email masih kosong");
regtxtEmail.requestFocus();
} else if (!Helper.isEmailValid(regtxtEmail)) {
regtxtEmail.setError("Format email salah");
regtxtEmail.requestFocus();
} else if (Helper.isEmpty(regtxtPassword1)) {
regtxtPassword1.setError("Password masih kosong");
regtxtPassword1.requestFocus();
} else if (Helper.isEmpty(regtxtPassword2)) {
regtxtPassword2.setError("Konfirmasi password masih kosong");
regtxtPassword2.requestFocus();
} else if (Helper.isCompare(regtxtPassword1, regtxtPassword2)) {
regtxtPassword2.setError("Password tidak cocok");
regtxtPassword2.requestFocus();
}

else if (Helper.isEmpty(regtxtPhone1)) {
regtxtPhone1.setError(" nomor masih kosong");
regtxtPhone1.requestFocus();
}
else {
String URL = Helper.BASE_URL + "register.php";
Map param = new HashMap();
param.put("email", regtxtEmail.getText().toString());
param.put("password", regtxtPassword1.getText().toString());
param.put("telpon", regtxtPhone1.getText().toString());
ProgressDialog pd = new ProgressDialog(context);
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.setInverseBackgroundForced(false);
pd.setCanceledOnTouchOutside(false);
pd.setTitle("Info");
pd.setMessage("Sedang menambah data");
pd.show();
try {
aQuery.progress(pd).ajax(URL, param, String.class, new

AjaxCallback() {
@Override
public void callback(String url, String object,
AjaxStatus status) {
if (object != null) {
try {

Universitas Sumatera Utara

6
JSONObject jsonObject = new
JSONObject(object);
String result =
jsonObject.getString("result");
String msg = jsonObject.getString("msg");
if (result.equalsIgnoreCase("true")) {
startActivity(new Intent(context,
Login.class));
Helper.pesan(context, msg);
finish();

} else {
Helper.pesan(context, msg);
}
} catch (JSONException e) {
Helper.pesan(context, "Error convert data
json");
}
}
}
});
} catch (Exception e) {
Helper.pesan(context, "Gagal mengambil data");
}
}
}
private void setupView() {
regtxtEmail = (MaterialEditText) findViewById(R.id.regtxtEmail);
regtxtPassword1 = (MaterialEditText)
findViewById(R.id.regtxtPassword1);
regtxtPassword2 = (MaterialEditText)
findViewById(R.id.regtxtPassword2);
regtxtPhone1 = (MaterialEditText) findViewById(R.id.regtxtPhone1);
regbtnRegister = (Button) findViewById(R.id.regbtnRegister);
reglblLogin = (TextView) findViewById(R.id.reglblLogin);
}
}

Login.java
package com.example.alwi.iseminar;
import
import
import
import
import
import
import

android.app.ProgressDialog;
android.content.Intent;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.widget.Button;
android.view.View;
android.widget.TextView;

import com.androidquery.callback.AjaxCallback;
import com.androidquery.callback.AjaxStatus;
import com.rengwuxian.materialedittext.MaterialEditText;
import org.json.JSONException;
import org.json.JSONObject;

Universitas Sumatera Utara

7
import java.util.HashMap;
import java.util.Map;
public class Login extends BaseApp {
private MaterialEditText logtxtEmail, logtxtPassword;
private TextView loglblRegister;
private Button logbtnLogin;
SessionManager sessionManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
setupView();
sessionManager = new SessionManager(getApplicationContext());
loglblRegister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
view.startAnimation(BtnAnimasi);
startActivity(new Intent(getApplicationContext(),
Register.class));
}
});
logbtnLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
loginUser();
}
});
}
private void loginUser() {
logtxtEmail.setError(null);
logtxtPassword.setError(null);
if (Helper.isEmpty(logtxtEmail)) {
logtxtEmail.setError("Email masih kosong");
logtxtEmail.requestFocus();
} else if (Helper.isEmpty(logtxtPassword)) {
logtxtPassword.setError("Password masih kosong");
logtxtPassword.requestFocus();
} else {
String URL = Helper.BASE_URL + "login.php";
Map param = new HashMap();
param.put("email", logtxtEmail.getText().toString());
param.put("password", logtxtPassword.getText().toString());
ProgressDialog pd = new ProgressDialog(context);
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.setInverseBackgroundForced(false);
pd.setCanceledOnTouchOutside(false);
pd.setTitle("Info");
pd.setMessage("Login");
pd.show();
try {
aQuery.progress(pd).ajax(URL, param, String.class, new
AjaxCallback() {

Universitas Sumatera Utara

8
@Override
public void callback(String url, String object,
AjaxStatus status) {
if (object != null) {
try {
JSONObject jsonObject = new
JSONObject(object);
String result =
jsonObject.getString("result");
String msg = jsonObject.getString("msg");
if (result.equalsIgnoreCase("true")) {
sessionManager.createSession(logtxtEmail.getText().toString());
startActivity(new Intent(context,
MainActivity2.class));
Helper.pesan(context, msg);
finish();
} else {
Helper.pesan(context, msg);
}
} catch (JSONException e) {
Helper.pesan(context, "Error convert data
json");
}
}
}
});
} catch (Exception e) {
Helper.pesan(context, "Gagal mengambil data");
}
}
}
private void setupView() {
logtxtEmail = (MaterialEditText) findViewById(R.id.logtxtEmail);
logtxtPassword = (MaterialEditText)
findViewById(R.id.logtxtPassword);
logbtnLogin = (Button) findViewById(R.id.logbtnLogin);
loglblRegister = (TextView) findViewById(R.id.loglblRegister);
}
}

MainActivity2.java
package com.example.alwi.iseminar;
import
import
import
import
import
import
import
import
import
import
import
import

android.app.Activity;
android.app.ProgressDialog;
android.content.Intent;
android.net.Uri;
android.os.PowerManager;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.text.Html;
android.util.Log;
android.view.View;
android.widget.Button;
android.widget.ImageButton;

Universitas Sumatera Utara

9
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import
import
import
import
import
import
import
import
import

java.io.DataOutputStream;
java.io.File;
java.io.FileInputStream;
java.io.FileNotFoundException;
java.io.IOException;
java.net.HttpURLConnection;
java.net.MalformedURLException;
java.net.URL;
java.util.HashMap;

public class MainActivity2 extends AppCompatActivity implements
View.OnClickListener {
SessionManager sessionManager;
private static final int PICK_FILE_REQUEST = 1;
private static final String TAG = MainActivity.class.getSimpleName();
private String selectedFilePath;
private String SERVER_URL =
"http://192.168.43.105/coderefer.com/extras/UploadToServer.php";
ImageView ivAttachment;
Button bUpload;
TextView tvFileName;
ProgressDialog dialog;
PowerManager.WakeLock wakeLock;
private TextView txtprofil;
private ImageButton btnlogout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
ivAttachment = (ImageView) findViewById(R.id.ivAttachment);
bUpload = (Button) findViewById(R.id.b_upload);
tvFileName = (TextView) findViewById(R.id.tv_file_name);
ivAttachment.setOnClickListener(this);
bUpload.setOnClickListener(this);
txtprofil = (TextView)findViewById(R.id.txtprofil1);
btnlogout = (ImageButton)findViewById(R.id.btnlogout);
btnlogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sessionManager.logout();
}
});
sessionManager = new SessionManager(getApplicationContext());
HashMap user = sessionManager.getUserDetails();
String name = user.get(SessionManager.kunci_email);
txtprofil.setText(Html.fromHtml("" + name + ""));
}
@Override
public void onClick(View v) {
if (v == ivAttachment) {

Universitas Sumatera Utara

10
//on attachment icon click
showFileChooser();
}
if (v == bUpload) {
//on upload button Click
if (selectedFilePath != null) {
dialog = ProgressDialog.show(MainActivity2.this, "",
"Uploading File...", true);
new Thread(new Runnable() {
@Override
public void run() {
try {
//creating new thread to handle Http Operations
uploadFile(selectedFilePath);
} catch (OutOfMemoryError e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity2.this,
"Insufficient Memory!", Toast.LENGTH_SHORT).show();
}
});
dialog.dismiss();
}
}
}).start();
} else {
Toast.makeText(MainActivity2.this, "Please choose a File
First", Toast.LENGTH_SHORT).show();
}
}
}
private void showFileChooser() {
Intent intent = new Intent();
//sets the select file to all types of files
intent.setType("file/*");
//allows to select data and return it
intent.setAction(Intent.ACTION_GET_CONTENT);
//starts new activity to select file and return data
startActivityForResult(Intent.createChooser(intent, "Choose File to
Upload.."), PICK_FILE_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
if (requestCode == PICK_FILE_REQUEST) {
if (data == null) {
//no data present
return;

Universitas Sumatera Utara

11
}
PowerManager powerManager = (PowerManager)
getSystemService(POWER_SERVICE);
wakeLock =
powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, TAG);
wakeLock.acquire();
Uri selectedFileUri = data.getData();
selectedFilePath = FilePath.getPath(this, selectedFileUri);
Log.i(TAG, "Selected File Path:" + selectedFilePath);
if (selectedFilePath != null &&
!selectedFilePath.equals("")) {
tvFileName.setText(selectedFilePath);
} else {
Toast.makeText(this, "Cannot upload file to server",
Toast.LENGTH_SHORT).show();
}
}
}
}
public int uploadFile(final String selectedFilePath) {
int serverResponseCode = 0;
HttpURLConnection connection;
DataOutputStream dataOutputStream;
String lineEnd = "\r\n";
String twoHyphens = "--";
String boundary = "*****";
int bytesRead, bytesAvailable, bufferSize;
byte[] buffer;
int maxBufferSize = 1 * 1024 * 1024;
File selectedFile = new File(selectedFilePath);
String[] parts = selectedFilePath.split("/");
final String fileName = parts[parts.length - 1];
if (!selectedFile.isFile()) {
dialog.dismiss();
runOnUiThread(new Runnable() {
@Override
public void run() {
tvFileName.setText("Source File Doesn't Exist: " +
selectedFilePath);
}
});
return 0;
} else {
try {
FileInputStream fileInputStream = new
FileInputStream(selectedFile);
URL url = new URL(SERVER_URL);
connection = (HttpURLConnection) url.openConnection();

Universitas Sumatera Utara

12
connection.setDoInput(true);//Allow Inputs
connection.setDoOutput(true);//Allow Outputs
connection.setUseCaches(false);//Don't use a cached Copy
connection.setRequestMethod("POST");
connection.setRequestProperty("Connection", "Keep-Alive");
connection.setRequestProperty("ENCTYPE", "multipart/formdata");
connection.setRequestProperty(
"Content-Type", "multipart/form-data;boundary=" +
boundary);
connection.setRequestProperty("uploaded_file",selectedFilePath);
//creating new dataoutputstream
dataOutputStream = new
DataOutputStream(connection.getOutputStream());
//writing bytes to data outputstream
dataOutputStream.writeBytes(twoHyphens + boundary +
lineEnd);
dataOutputStream.writeBytes("Content-Disposition: formdata; name=\"uploaded_file\";filename=\""
+ selectedFilePath + "\"" + lineEnd);
dataOutputStream.writeBytes(lineEnd);
//returns no. of bytes present in fileInputStream
bytesAvailable = fileInputStream.available();
//selecting the buffer size as minimum of available bytes
or 1 MB
bufferSize = Math.min(bytesAvailable, maxBufferSize);
//setting the buffer as byte array of size of bufferSize
buffer = new byte[bufferSize];
//reads bytes from FileInputStream(from 0th index of buffer
to buffersize)
bytesRead = fileInputStream.read(buffer, 0, bufferSize);
//loop repeats till bytesRead = -1, i.e., no bytes are left
to read
while (bytesRead > 0) {
try {
//write the bytes read from inputstream
dataOutputStream.write(buffer, 0, bufferSize);
} catch (OutOfMemoryError e) {
Toast.makeText(MainActivity2.this, "Insufficient
Memory!", Toast.LENGTH_SHORT).show();
}
bytesAvailable = fileInputStream.available();
bufferSize = Math.min(bytesAvailable, maxBufferSize);
bytesRead = fileInputStream.read(buffer, 0,
bufferSize);
}
dataOutputStream.writeBytes(lineEnd);
dataOutputStream.writeBytes(twoHyphens + boundary +
twoHyphens + lineEnd);

Universitas Sumatera Utara

13
try{
serverResponseCode = connection.getResponseCode();
}catch (OutOfMemoryError e){
Toast.makeText(MainActivity2.this, "Memory
Insufficient!", Toast.LENGTH_SHORT).show();
}
String serverResponseMessage =
connection.getResponseMessage();
Log.i(TAG, "Server Response is: " + serverResponseMessage +
": " + serverResponseCode);
//response code of 200 indicates the server status OK
if (serverResponseCode == 200) {
runOnUiThread(new Runnable() {
@Override
public void run() {
tvFileName.setText("File Upload completed.\n\n
You can see the uploaded file here: \n\n" + "coderefer.com/extras/uploads"
+ fileName);
}
});
}
//closing the input and output streams
fileInputStream.close();
dataOutputStream.flush();
dataOutputStream.close();
if (wakeLock.isHeld()) {
wakeLock.release();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity2.this, "File Not
Found", Toast.LENGTH_SHORT).show();
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity2.this, "URL Error!",
Toast.LENGTH_SHORT).show();
}
});
} catch (IOException e) {
e.printStackTrace();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity2.this, "Cannot
Read/Write File", Toast.LENGTH_SHORT).show();

Universitas Sumatera Utara

14
}
});
}
dialog.dismiss();
return serverResponseCode;
}
}
}

List.Java
package com.example.alwi.iseminar;
import
import
import
import
import
import
import

android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.view.KeyEvent;
android.view.Window;
android.webkit.WebSettings;
android.webkit.WebView;
android.webkit.WebViewClient;

public class List extends AppCompatActivity {
WebView website;
String url="http://192.168.43.105/seminar/index.php";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_list);
website=(WebView)findViewById(R.id.website);
website.getSettings().setJavaScriptEnabled(true);
website.setFocusable(true);
website.setFocusableInTouchMode(true);
website.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
website.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
website.getSettings().setDomStorageEnabled(true);
website.getSettings().setDatabaseEnabled(true);
website.getSettings().setAppCacheEnabled(true);
website.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
website.loadUrl(url);
website.setWebViewClient(new WebViewClient(){
public void onReceivedError(WebView view,int errorCode,String
description, String failingUrl){
website.loadUrl(url);
}
});
}
@Override

Universitas Sumatera Utara

15
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK && website.canGoBack()) {
//back to previous url
website.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}

FilePath.java
package com.example.alwi.iseminar;
/**
* Created by Alwi on 04/06/2017.
*/
import
import
import
import
import
import
import
import
import

android.annotation.TargetApi;
android.content.ContentUris;
android.content.Context;
android.database.Cursor;
android.net.Uri;
android.os.Build;
android.os.Environment;
android.provider.DocumentsContract;
android.provider.MediaStore;

public class FilePath {
/**
* Method to return file path of selected file
*
* @param context
* @param uri
* @return path of the selected file from directory
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
public static String getPath(final Context context, final Uri uri) {
// check here to KITKAT or new version
final boolean isKitKat = Build.VERSION.SDK_INT >=
Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);

Universitas Sumatera Utara

16
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/"
+ split[1];
}
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"),
Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri =
MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri =
MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri =
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[] { split[1] };
return getDataColumn(context, contentUri, selection,
selectionArgs);
}
}
// MediaStore (and general)
else if ("content".equalsIgnoreCase(uri.getScheme())) {
// Return the remote address
if (isGooglePhotosUri(uri))
return uri.getLastPathSegment();
return getDataColumn(context, uri, null, null);
}
// File
else if ("file".equalsIgnoreCase(uri.getScheme())) {
return uri.getPath();
}
return null;
}
/**

Universitas Sumatera Utara

17
*
*
*
*
*
*
*
*
*
*
*
*

Get the value of the data column for this Uri. This is useful for
MediaStore Uris, and other file-based ContentProviders.
@param context
The context.
@param uri
The Uri to query.
@param selection
(Optional) Filter used in the query.
@param selectionArgs
(Optional) Selection arguments used in the query.
@return The value of the _data column, which is typically a file

path.
*/
public static String getDataColumn(Context context, Uri uri,
String selection, String[]
selectionArgs) {
Cursor cursor = null;
final String column = "_data";
final String[] projection = { column };
try {
cursor = context.getContentResolver().query(uri, projection,
selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
final int index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
/**
* @param uri
*
The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
public static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri
.getAuthority());
}
/**
* @param uri
*
The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
public static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri
.getAuthority());
}
/**
* @param uri
*
The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/

Universitas Sumatera Utara

18
public static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri
.getAuthority());
}
/**
* @param uri
*
The Uri to check.
* @return Whether the Uri authority is Google Photos.
*/
public static boolean isGooglePhotosUri(Uri uri) {
return "com.google.android.apps.photos.content".equals(uri
.getAuthority());
}
}

Activity_List.xml






Activity_Login.xml










Universitas Sumatera Utara

20
Activity_Register.xml












DB.php


Login.php


Register.php