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
| import java.math.BigInteger; | |
| import java.util.Scanner; | |
| public class Fibonacci { | |
| static double num; | |
| static Runtime runtime = Runtime.getRuntime(); | |
| static long maxMem, allocMem; | |
| static long startTime, endTime; |
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
| public class AppSingleton { | |
| private AppSingleton() { | |
| } | |
| private static class SingletonHelper{ | |
| private static final AppSingleton INSTANCE = new AppSingleton(); | |
| } | |
| public static AppSingleton getInstance(){ |
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.example.client; | |
| import java.io.DataInputStream; | |
| import java.io.DataOutputStream; | |
| import java.io.IOException; | |
| import java.net.Socket; | |
| import java.util.HashMap; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; |
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
| /** | |
| * Created by Bahaa on 4/7/2018. | |
| */ | |
| package com.example.server; | |
| import java.net.*; | |
| import java.io.*; | |
| import java.util.Base64; | |
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
| /** | |
| * Created by Bahaa on 4/7/2018. | |
| */ | |
| package com.example.bahaa.clientapp; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.os.AsyncTask; |
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 SpannableStringBuilder customErrorText(String msg){ | |
| int eColor = Color.parseColor("#000000"); // whatever color you want | |
| ForegroundColorSpan fgcspan = new ForegroundColorSpan(eColor); | |
| SpannableStringBuilder textBuilder = new SpannableStringBuilder(msg); | |
| textBuilder.setSpan(fgcspan, 0, msg.length(), 0); | |
| return textBuilder; | |
| } |
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
| //To reverse the switch ENABLE/DISABLE Text color against the switch thumb color | |
| public static void setSwitchColor(SwitchCompat v) { | |
| // thumb regular color | |
| int thumbColor = Color.parseColor("#00E5FF"); | |
| // track regular color | |
| int trackColor = Color.parseColor("#00B8D4"); | |
| // setting the thumb color on action | |
| DrawableCompat.setTintList(v.getThumbDrawable(), new ColorStateList( |
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.example.bahaaibrahim.firebasetest; | |
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.support.annotation.NonNull; | |
| import android.support.design.widget.FloatingActionButton; | |
| import android.support.design.widget.Snackbar; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.text.TextUtils; |
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.example.bahaaibrahim.firebasetest; | |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.support.annotation.NonNull; | |
| import android.support.design.widget.FloatingActionButton; | |
| import android.support.design.widget.Snackbar; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.view.View; |
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
| public class MainActivity extends AppCompatActivity { | |
| public Button mSendButton; | |
| public DatabaseReference mDatabase; | |
| public HashMap<String, String> dataMap; | |
| public TextView retData; | |
| public String name; | |