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
/** | |
* Place this Snippet in Activity File | |
* Secure `YOUR_GOOGLE_PLACE_API_KEY` Key in Build Config, if you need | |
*/ | |
/** | |
* `etGoogleplaceApi` stands for AutocompleteEditText Widget | |
* Add Your Billings Details in Google Console, OR else it throws `QUERY_LIMIT_EXCEEDED` exception |
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 <your pacakage name>; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.TextureView; | |
/** | |
* A {@link TextureView} that can be adjusted to a specified aspect ratio. | |
*/ | |
public class AutoFitTextureView extends TextureView { |
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 <your pacakage name>; | |
import android.Manifest; | |
import android.annotation.SuppressLint; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.Context; | |
import android.content.ContextWrapper; | |
import android.content.DialogInterface; |
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 SampleActivity extends AppCompatActivity { | |
/** | |
* Sample Snippet for Registering Receiver | |
*/ | |
MyBroadcastReceiver myBroadCastReceiver; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(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
private void addAutoStartupswitch() { | |
try { | |
Intent intent = new Intent(); | |
String manufacturer = android.os.Build.MANUFACTURER .toLowerCase(); | |
String model= Build.MODEL; | |
Log.d("DeviceModel",model.toString()); | |
switch (manufacturer){ | |
case "xiaomi": |
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
/*default initializations for android activity file*/ | |
/* here we gone a simple implementaion for Dollar Sign based on the type specified | |
R.string.Dollar ="$$$$" | |
*/ | |
SpannableStringBuilder builder = new SpannableStringBuilder(); | |
Textview textView_colchar=(TextView)findViewById(R.id.textView_colchar); | |
int type=1; //change based on the type needed ... | |
switch (type){ |