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
package com.example.learningfirebase; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.AdapterView; | |
import android.widget.ArrayAdapter; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.ListView; | |
import android.widget.ProgressBar; |
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
package com.example.learningfirebase; | |
import android.content.ContentResolver; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.webkit.MimeTypeMap; | |
import android.widget.Button; | |
import android.widget.ImageView; |
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
package com.example.learningfirebase; | |
import android.content.ContentResolver; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.view.View; | |
import android.webkit.MimeTypeMap; | |
import android.widget.ArrayAdapter; |
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
package com.example.learningfirebase; | |
import androidx.annotation.NonNull; | |
import androidx.appcompat.app.AppCompatActivity; | |
import androidx.recyclerview.widget.LinearLayoutManager; | |
import androidx.recyclerview.widget.RecyclerView; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; |
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
package com.example.firebaseproject2; | |
import androidx.annotation.NonNull; | |
import androidx.annotation.Nullable; | |
import androidx.appcompat.app.AlertDialog; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.ContentResolver; | |
import android.content.Context; |
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
package com.example.webview01; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.webkit.WebView; | |
import android.webkit.WebViewClient; | |
import android.widget.Button; |
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
package com.example.whatsappmyapp; | |
import androidx.annotation.NonNull; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.app.ProgressDialog; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.text.TextUtils; | |
import android.view.View; |
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
/**Start Access the mobile file location for get the image and set the image into image view*/ | |
private void FileChooser() { | |
Intent intent = new Intent(); | |
intent.setType("image/*"); | |
intent.setAction(Intent.ACTION_GET_CONTENT); | |
startActivityForResult(intent,1); | |
} | |
@Override | |
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); |
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
/**Start the image save to Firebase Storage in the database*/ | |
private String getExtension(Uri uri){ | |
ContentResolver contentResolver = getContentResolver(); //using for get the extention in image. | |
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton(); | |
return mimeTypeMap.getExtensionFromMimeType(contentResolver.getType(uri)); | |
} | |
private void FileUploader() { | |
storageTask = storageReference.child(System.currentTimeMillis()+"."+getExtension(imguri)).putFile(imguri) | |
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { | |
@Override |
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
final StorageReference filePath = storageReference.child(messagePushId + "." + "jpg"); | |
uploadTask = filePath.putFile(fileUri); | |
uploadTask.continueWithTask(new Continuation() { | |
@Override | |
public Object then(@NonNull Task task) throws Exception { | |
if (!task.isSuccessful()){ | |
throw task.getException(); | |
} | |
return filePath.getDownloadUrl(); |
OlderNewer