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
var api_key = "Buraya Product Hunt API Key Gelecek"; | |
var api_secret = "Buraya Product Hun API Secret Gelecek"; | |
var api = { | |
getToken: function() { | |
var r = { | |
method: 'POST', | |
headers: { | |
'Accept': 'application/json', |
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 string GenerateUniqueKey(int maxSize) | |
{ | |
char[] chars = new char[62]; | |
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray(); | |
byte[] data = new byte[1]; | |
RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider(); | |
crypto.GetNonZeroBytes(data); | |
data = new byte[maxSize]; | |
crypto.GetNonZeroBytes(data); | |
StringBuilder result = new StringBuilder(maxSize); |
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
boolean DataOnOff(boolean status, Context context) { | |
int bv = 0; | |
try { | |
if (bv == Build.VERSION_CODES.FROYO){ | |
//android 2.2 versiyonu için | |
Method dataConnSwitchmethod; | |
Class<?> telephonyManagerClass; | |
Object ITelephonyStub; | |
Class<?> ITelephonyClass; |
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 Util { | |
static JSONObject jObj = null; | |
static String json = ""; | |
public Util(){} | |
public JSONObject GetJSON(String URL) throws JSONException{ | |
try { |
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 static float distFrom (float lat1, float lng1, float lat2, float lng2) | |
{ | |
double earthRadius = 3958.75; | |
double dLat = Math.toRadians(lat2-lat1); | |
double dLng = Math.toRadians(lng2-lng1); | |
double a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * | |
Math.sin(dLng/2) * Math.sin(dLng/2); | |
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); |
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
boolean ScreenBrightness(int level, Context context) { | |
try { | |
android.provider.Settings.System.putInt( | |
context.getContentResolver(), | |
android.provider.Settings.System.SCREEN_BRIGHTNESS, level); | |
android.provider.Settings.System.putInt(context.getContentResolver(), | |
android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE, |
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
boolean BluetoothOnOff(boolean status, Context context) { | |
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter | |
.getDefaultAdapter(); | |
try { | |
if (status) { | |
if (!mBluetoothAdapter.isEnabled()) { | |
mBluetoothAdapter.enable(); | |
} | |
} else { | |
if (mBluetoothAdapter.isEnabled()) { |
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
if(internetErisimi()){ | |
{ | |
startActivity(new Intent (BaslangicSayfasi.this,AnaSayfa.class)); | |
} | |
} | |
else{ | |
AlertDialog alertDialog = new AlertDialog.Builder(this).create(); |
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 asyncTaskOrnek extends AsyncTask<String,String,String> |
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 OrnekActivity extends Activity { | |
private Intent intent; | |
private Bundle bundle; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.ornek_activity); |