This file contains 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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Stringlerde sorun çıkmaması için encoding yapıyoruz | |
NSString *param_ad = [@"Melih" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
NSString *param_soyad = [@"Mucuk" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
NSInteger *param_id = 1; | |
//Parametreleri verirken stringler için %@ , integer için ise %d kullanıyoruz |
This file contains 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
<uses-sdk | |
android:minSdkVersion="10" | |
android:targetSdkVersion="15"/> |
This file contains 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); |
This file contains 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 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 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 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 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 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 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; |
OlderNewer