Skip to content

Instantly share code, notes, and snippets.

View luckycreationsindia's full-sized avatar
💻
print('Programming is life 👨‍💻')

Lokesh Jain luckycreationsindia

💻
print('Programming is life 👨‍💻')
View GitHub Profile
@luckycreationsindia
luckycreationsindia / SparseArrayAdapter.java
Created March 5, 2016 08:42
SparseArrayAdapter for Spinner and Listview
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;
@luckycreationsindia
luckycreationsindia / HideApp.java
Last active March 15, 2016 11:15
A sample Snippet to Hide App in Android
PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
@luckycreationsindia
luckycreationsindia / HideApp - Manifest Method
Last active March 15, 2016 11:20
A Sample Snippet to Hide App in Android - 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 / Call App from Dial Pad
Created March 15, 2016 11:24
A Sample Snippet to Run App by Dialing certain number in dialpad
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 / Readme.md
Created September 12, 2016 21:07 — forked from mrgcohen/Readme.md
Twitter Bootstrap Typeahead autocomplete example

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

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

@luckycreationsindia
luckycreationsindia / ClassLoaderActivity.java
Created November 7, 2016 07:35 — forked from marshall/ClassLoaderActivity.java
A reflection hack to override the APK ClassLoader so you can launch Activities in an external JAR.
//
// !!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);
<!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>