Skip to content

Instantly share code, notes, and snippets.

View Ahmedbadereldin's full-sized avatar
🏠
Working from home

Ahmed M Bader El-Din Ahmedbadereldin

🏠
Working from home
View GitHub Profile
@Ahmedbadereldin
Ahmedbadereldin / BaseActivity.java
Created February 7, 2018 22:29 — forked from himanshu-soni/BaseActivity.java
Base Activity to detect internet connection GPS disabled. It shows dialog to enable them too :)
package com.djhs16.location;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
@Ahmedbadereldin
Ahmedbadereldin / Send Notification Firbase Android Java
Last active August 6, 2019 08:57
Working easily with FCM push notifications in Android ,
final private String FCM_API = "https://fcm.googleapis.com/fcm/send";
//server Key => get From Your Firbase account
final private String serverKey = "key=" + "AAAA.......";
final private String contentType = "application/json";
final String TAG = "NOTIFICATION TAG";
------------------------------------------------------------------------------------
newMessageDoc.set(newChatMessage).addOnCompleteListener(task -> {
if (task.isSuccessful()) {
@Ahmedbadereldin
Ahmedbadereldin / Open WhatsApp Messaging
Last active August 6, 2019 09:04
this code open whatsapp to send message direct from your app to whatsapp (^_^)
String number = "+970598074212"
/////////////////////////////////////////////////////////////
btn_send_message_whatsapp.setOnClickListener(v -> {
onClickWhatsApp("970598074212");// hint without +
// if the number with + like +970598074212
//using
//onClickWhatsApp(number.substring(1));
});
///////////////////////Open Whatsapp////////////////////////
@Ahmedbadereldin
Ahmedbadereldin / Image Picker In Android 10
Created October 13, 2019 19:08
When I needed to arrive for the first time to storage in Android 10 , I met many problems from this probleams : Knowing that these problems after I give the permission.
When I needed to arrive for the first time to storage in Android 10 , I met many problems from this probleams :
Knowing that these problems after I give the permission.
* in this example using media-picker-android libray
Link : https://github.com/iamthevoid/media-picker-android
1- open failed: EACCES (Permission denied)
* when you show this probleam you need added this lines in your mainfist
<application
...
package com.techzone.moshtapp.chating;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
// ApiInterface
@Multipart
@POST("user/add-image")
Call<ResultAPIModel<MemberModelX>> uploadProfileImage(@HeaderMap() Map<String, Object> headerParams, @Part MultipartBody.Part image);
public void uploadImage(String uri) {
File file = new File(uri);
@Ahmedbadereldin
Ahmedbadereldin / Ahmed M Bader El-Din
Last active March 19, 2020 11:37
Ahmed M Bader El-Din
https://play.google.com/store/apps/details?id=com.techzone.moshtapp
https://play.google.com/store/apps/details?id=com.app.linkme
https://play.google.com/store/apps/details?id=com.daleni.usersapp
https://play.google.com/store/apps/details?id=com.canny.canny.cannycustomer
https://play.google.com/store/apps/details?id=com.ahmedbadereldin.hp.phonexworkerapp
https://play.google.com/store/apps/details?id=com.techzone.shaghe
https://play.google.com/store/apps/details?id=com.ibtikarat.tahadi
https://play.google.com/store/apps/details?id=com.sanedapp.efhasapp
https://play.google.com/store/apps/details?id=com.eie.arfuf
https://play.google.com/store/apps/details?id=com.ennervoice.user
#--------
-keep class com.jumio.** { *; }
-keep class jumio.** { *; }
-keep class com.microblink.** { *; }
-keep class com.microblink.**$* { *; }
-keep class com.facetec.zoom.** { *; }
-keep class org.jmrtd.** { *; }
-keep class net.sf.scuba.** {*;}
-keep class org.bouncycastle.** {*;}
package com.ennervoice.user.Utils;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@Ahmedbadereldin
Ahmedbadereldin / AndroidNetworking.java
Last active September 1, 2020 08:13
upload file with AndroidNetworking
Map<String, File> multiPartFileMap = new HashMap<>();
if (!PathHolder.equals("")) {
multiPartFileMap.put("attachment", new File(PathHolder));
}
Map<String, String> parames = new HashMap<>();
parames.put("name", name);
parames.put("email", email);
parames.put("message", details);
parames.put("subject", subject);