Skip to content

Instantly share code, notes, and snippets.

View ahmadmust8's full-sized avatar

Ahmad Mustafa ahmadmust8

  • in the cloud
View GitHub Profile
@Kozlov-V
Kozlov-V / gist:6129942
Last active September 13, 2016 02:56
Android Button
public class Demo extends Activity {
private View.OnClickListener curlPostListener;
private Button curlPost;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
InitializeApp();
}
@SimoneLocatelli
SimoneLocatelli / findViewByIdWithoutCasting.java
Last active December 26, 2016 13:34
Android code snippet to avoid casting when call findViewById method http://jabtw.blogspot.it/2013/12/android-find-view-without-casting.html
T findViewByIdWithoutCasting(int id) {
T item = CS.as(getActivity().findViewById(id));
return item;
}
@rameshakulapc
rameshakulapc / SystemUtil.java
Last active January 2, 2017 12:10
Basic system utility methods
package com.andhradroid.util;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.text.DecimalFormat;
import java.util.Enumeration;
@YousufSohail
YousufSohail / FloatingActionButton.java
Created July 28, 2015 09:37
Implementation of Android Lollipop floating action button pattern. API 14+
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@olcayertas
olcayertas / CalculateQiblaAngle.java
Last active April 25, 2017 00:58
Calculates qibla angel acording to curren location.
private static final double KAABA_LONGITUDE = 39.826228;
private static final double KAABA_LATITUDE = 21.422305;
private double getQiblaAngele(double myLatitude, double myLongitude) {
double sinMyLoMinusQLo = Math.sin(myLongitude - KAABA_LONGITUDE);
double cosMyLat = Math.cos(myLatitude);
double tanQLat = Math.tan(KAABA_LATITUDE);
double sinMyLat = Math.sin(myLatitude);
double cosMyLoMinusQlo = Math.cos(myLongitude - KAABA_LONGITUDE);
@layemut
layemut / README.md
Last active February 13, 2021 13:24
Set of methods to save values to and get values from SharedPreferences.

SharedPreferencesUtils

Set of methods to save values to and get values from SharedPreferences.

Set-up

Set context to it before using, for example in Activity's onCreate.

  @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

تطوير تطبيقات الشبكة العنكبوتية في عام 2017

الدراسة الجامعية أم التعليم الذاتي لتعلم البرمجة؟

    هذا هو ثاني مقال أكتبه ردا على أسئلة تصلني، ففي مقال سابق كتبت عن تطوير تطبيقات الشبكة العنكبوتية لعام 2017 رداً على سؤال أحد طلابي بعد انتهائنا من مادة تطوير تطبيقات الشبكة العنكبوتية. في هذا المقال سأحاول بإذن الله الإجابة