Skip to content

Instantly share code, notes, and snippets.

View ahmedbr's full-sized avatar
💻
Coding the FUTURE!

Ahmed Breem ahmedbr

💻
Coding the FUTURE!
View GitHub Profile
@ahmedbr
ahmedbr / android-getDate.txt
Last active May 11, 2019 01:30
Android/Converting TimeStamp into Date.
private String getDate(long time) {
Calendar cal = Calendar.getInstance(Locale.ENGLISH);
cal.setTimeInMillis(time * 1000);
String date = DateFormat.format("dd-MM-yyyy", cal).toString();
return date;
}
@ahmedbr
ahmedbr / model-celsius-fahrenheit.ipynb
Created March 7, 2019 10:17
model-celsius-fahrenheit.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ahmedbr
ahmedbr / AndroidManifest.xml
Created March 4, 2019 12:57 — forked from cofearabi/AndroidManifest.xml
Android sample appli which read Excel file and display the data of the sheet.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.andexcelread0"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
@ahmedbr
ahmedbr / Android - Activate "Share" button in your App
Created September 30, 2018 20:38
This gist is for activating share button in your android application.
// add the following code to your button:
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "Here is the share content body";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));
Here's a table of percentages to hex values. E.g. for 50% white you'd use #80FFFFFF.
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Toast.makeText(context, "Your text goes here ...", Toast.LENGTH_LONG).show();
}
});
android.app.action.ACTION_PASSWORD_CHANGED
android.app.action.ACTION_PASSWORD_EXPIRING
android.app.action.ACTION_PASSWORD_FAILED
android.app.action.ACTION_PASSWORD_SUCCEEDED
android.app.action.DEVICE_ADMIN_DISABLED
android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED
android.app.action.DEVICE_ADMIN_ENABLED
android.app.action.DEVICE_OWNER_CHANGED
android.app.action.INTERRUPTION_FILTER_CHANGED
android.app.action.LOCK_TASK_ENTERING
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
addCourseText = (EditText) findViewById(R.id.clEtAddCourse);
addCourseText.setOnKeyListener(new OnKeyListener()
{
public boolean onKey(View v, int keyCode, KeyEvent event)
{
if (event.getAction() == KeyEvent.ACTION_DOWN)
{
switch (keyCode)
{
case KeyEvent.KEYCODE_DPAD_CENTER: