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
import android.app.Activity; | |
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorManager; | |
import android.os.Bundle; | |
import android.view.animation.Animation; | |
import android.view.animation.RotateAnimation; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.company.product.package"> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:allowBackup="true" |
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 WifiTest | |
{ | |
// ringerMode = AudioManager.RINGER_MODE_SILENT; | |
// ringerMode = AudioManager.RINGER_MODE_VIBRATE; | |
// ringerMode = AudioManager.RINGER_MODE_NORMAL; | |
// WifiName="Home-Wifi"; | |
public static boolean setVolumeWhenThisWifiConnects(String WifiName,int ringerMode) | |
{ | |
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); |
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
package com.testing.name.locationservicetest; | |
import android.Manifest; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.location.Criteria; | |
import android.location.Location; | |
import android.location.LocationManager; | |
import android.os.AsyncTask; |
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 BackgroundService extends Service { | |
private static BroadcastReceiver mTickReceiver; | |
public BackgroundService() | |
{ | |
} | |
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 RgbView extends View { | |
Paint p=new Paint(); | |
public RgbView(Context context) { | |
super(context); | |
init(null, 0); | |
} | |
public RgbView(Context context, AttributeSet attrs) { | |
super(context, attrs); |
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 MainActivity extends AppCompatActivity { | |
boolean isPopped=false; | |
double h; | |
double w; | |
LinearLayout popUpFrame; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
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 JsonResponse extends AsyncTask<String, Void, String> | |
{ | |
String finalData = null; | |
@Override | |
protected String doInBackground(String... params) | |
{ | |
Uri.Builder ub = new Uri.Builder(); | |
ub.scheme("http").authority("api.someapi.com").appendPath("somepath") | |
.appendQueryParameter("lng", "") |
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
long date = System.currentTimeMillis(); | |
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); // or MMM MM dd, yyyy h:mm a to get time also | |
String dateString = sdf.format(date); |
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 MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
TabLayout tabLayout=(TabLayout)findViewById(R.id.tabs); | |
MyPagerAdapter myPagerAdapter=new MyPagerAdapter(getSupportFragmentManager()); | |
ViewPager viewPager=(ViewPager)findViewById(R.id.pager); | |
viewPager.setAdapter(myPagerAdapter); |
OlderNewer