Skip to content

Instantly share code, notes, and snippets.

View gotoark's full-sized avatar
🎯
Focusing

RAJESH KUMAR ARUMUGAM gotoark

🎯
Focusing
View GitHub Profile
@gotoark
gotoark / PackageInstaller.md
Last active January 29, 2018 11:50 — forked from zeuxisoo/gist:997485
Install and Uninstall Android applications with PackageInstaller

In android source code can get

<activity android:name=".PackageInstallerActivity">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="content" />
        <data android:scheme="file" />
@gotoark
gotoark / home_Menu_Tiles.xml
Created January 16, 2018 16:30
Sample Layout with Banner and Menu Tiles
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10"
tools:context="com.arkthepro.periyakuppam.Home">
@gotoark
gotoark / SPRING_E&S.md
Last active February 20, 2019 10:59
A Collection of Errors and Solutions faced in Spring Development ( Java EE )

😈 SPRING ERRORS and SOLUTIONS 😇

Error 😬

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.modelmapper.MappingException: ModelMapper mapping errors:
@gotoark
gotoark / download.html
Created November 28, 2017 05:26
Download File On Click
<a href="complexDownload" download="MyResume.docx" onclick="this.href='MyResume.docx';" class="white-text">My Resume</a>
@gotoark
gotoark / SetRingtone
Created November 15, 2017 18:57
Set Ringtone
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Settings.System.canWrite(context)) {
RingtoneManager.setActualDefaultRingtoneUri(
context,
RingtoneManager.TYPE_RINGTONE,
newUri
);
}else{
Log.e(TAG, "newUri: --------------------------------not granted this permission: android.permission.WRITE_SETTINGS" );
}
@gotoark
gotoark / backkeyClose
Created November 15, 2017 18:56
Ask for Exit on Back Key Pressed
@Override
public void onBackPressed() {
new AlertDialog.Builder(this).setIcon(R.drawable.ic_alert).setTitle("Exit")
.setMessage("Are you sure you want to exit?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
System.exit(0);
}
private boolean checkMyPermission(boolean isSecondTimeCheck) {
String dialogTitle = "need WRITE_SETTINGS permission";
if (isSecondTimeCheck) dialogTitle = "you deny the permission";
String btnTitle = "ok", if (isSecondTimeCheck) btnTitle = "try again";
if (Build.VERSION.SDK_INT >= 23) {
if (!Settings.System.canWrite(this)) {
new AlertDialog.Builder(mContext).setMessage(dialogTit le).setPositiveButton(btnTitle, new DialogInterface.OnClickListener() {
@override
@gotoark
gotoark / TransparentStyle.xml
Created November 8, 2017 11:49
Style to make Transparent Activity Theme
<resources>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
@gotoark
gotoark / thirukkural.sql
Created November 7, 2017 09:32
Create Thirukkural and Add all Necessary Data. Ref-https://github.com/tk120404/thirukkural/blob/master/detail.json
This file has been truncated, but you can view the full file.
BEGIN TRANSACTION;
CREATE TABLE thirukkural (
`Number` INT,
`Line1` VARCHAR(50) ,
`Line2` VARCHAR(34) ,
`Translation` VARCHAR(364) ,
`mv` VARCHAR(158),
`sp` VARCHAR(436) ,
`mk` VARCHAR(362) ,
`explanation` VARCHAR(210),
public class ConfigurableWidgetConfigureActivity extends Activity {
int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
private EditText etUrl;
private Button btAdd;
private AppWidgetManager widgetManager;
private RemoteViews views;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);