Skip to content

Instantly share code, notes, and snippets.

View achinverma's full-sized avatar
🎯
Focusing

Achin verma achinverma

🎯
Focusing
  • India
View GitHub Profile
@vikrum
vikrum / AndroidManifest.xml
Last active April 6, 2024 12:00
Firebase+Android sample app with background Service + local notifications.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bgfirebaseapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="17" />
@blackcj
blackcj / ActivityEventListener.md
Created August 15, 2013 19:53
Demonstrates how to call a function in the parent Activity from within a Fragment.

Step 1: Add any functions you want to call into the interface (EventListener).

Step 2: Implement those functions in your MainActivity.

Step 3: Create the listener in your Fragment and attach it to the Activity.

Step 4: Call any functions on the listener.

@Antarix
Antarix / SendSMS.java
Created August 23, 2013 09:27
Send SMS in android with delivery report
//---sends an SMS message to another device---
private void sendSMS(String phoneNumber, String message)
{
String SENT = "SMS_SENT";
String DELIVERED = "SMS_DELIVERED";
PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
new Intent(SENT), 0);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// details omitted
mPane = (SlidingPaneLayout) findViewById(R.id.pane);
mPane.openPane();
getSupportFragmentManager().beginTransaction()
public class ScrollDisabledListView extends ListView {
private int mPosition;
public ScrollDisabledListView(Context context) {
super(context);
}
public ScrollDisabledListView(Context context, AttributeSet attrs) {
super(context, attrs);
@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@sengupta
sengupta / LICENSE.txt
Last active December 17, 2022 03:34
Sample Webhook Receiver to test Instamojo's (or any web service's) webhook feature.
Copyright (c) 2014, Instamojo, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@Viyu
Viyu / DragAndDropActivity.java
Last active May 7, 2019 18:18
Android Drag And Drop Demo
package com.viyu.draganddropdemo;
import com.viyu.dradanddropdemo.R;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipDescription;
import android.os.Bundle;
import android.util.Log;
import android.view.DragEvent;
@tomoima525
tomoima525 / PictureCallback.java
Last active November 28, 2017 09:54
Android code to make jpeg picture that fits with camera preview size
PictureCallback jpegCallback=new PictureCallback(){
@Override
public void onPictureTaken(byte[] data, Camera camera) {
if(data !=null){
/* I use Galaxy S3 and Supported PictureSize was width = 3264px, height = 2448px, prop = 1.3333334
Because inSampleSize should be integer, I set maxSize a fraction of srcSize(Supported Picturesize)
*/
int maxSize = 816;
mCamera.stopPreview();