Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
print('Programming is life 👨‍💻')

Lucky luckycreationsindia

💻
print('Programming is life 👨‍💻')
View GitHub Profile
View gist:9a70a7a58e817ae17b8c959003006fe0
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@luckycreationsindia
luckycreationsindia / ClassLoaderActivity.java
Created Nov 7, 2016 — forked from marshall/ClassLoaderActivity.java
A reflection hack to override the APK ClassLoader so you can launch Activities in an external JAR.
View ClassLoaderActivity.java
//
// !!WARNING: Not recommended for production code!!
//
public class ClassLoaderActivity extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader());
setAPKClassLoader(dexLoader);
@luckycreationsindia
luckycreationsindia / Readme.md
Created Sep 12, 2016 — forked from mrgcohen/Readme.md
Twitter Bootstrap Typeahead autocomplete example
View Readme.md

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

This will use bootstrap with typeahead to create an autocomplete search.

@luckycreationsindia
luckycreationsindia / Call App from Dial Pad
Created Mar 15, 2016
A Sample Snippet to Run App by Dialing certain number in dialpad
View Call App from Dial Pad
public class DialBroad extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
if ((phoneNumber).equals("123456")){
Intent appIntent = new Intent(context, MainActivity.class);
appIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(appIntent);
@luckycreationsindia
luckycreationsindia / HideApp - Manifest Method
Last active Mar 15, 2016
A Sample Snippet to Hide App in Android - Manifest Method
View HideApp - Manifest Method
<activity
android:name="com.lcigroup.hideapp.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" /> //If APP requires broadcast receiver add this line
<!—
<category android:name="android.intent.category.LAUNCHER" /> //By commenting this the APP will not be shown in launcher
-->
@luckycreationsindia
luckycreationsindia / HideApp.java
Last active Mar 15, 2016
A sample Snippet to Hide App in Android
View HideApp.java
PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
@luckycreationsindia
luckycreationsindia / SparseArrayAdapter.java
Created Mar 5, 2016
SparseArrayAdapter for Spinner and Listview
View SparseArrayAdapter.java
import android.content.Context;
import android.content.res.Resources;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.util.Log;
import android.util.SparseArray;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
You can’t perform that action at this time.