Skip to content

Instantly share code, notes, and snippets.

@Antarix
Antarix / NotifyAlaramManger.java
Created Feb 19, 2014
Simple Alarm Manager for android
View NotifyAlaramManger.java
import java.util.Calendar;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import com.bhartiy.anywork.utils.Logcat;
public class NotifyAlaramManger {
@Antarix
Antarix / TypeWriter.java
Last active Mar 4, 2021
TextView animation like type writer
View TypeWriter.java
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.TextView;
public class TypeWriter extends TextView {
private CharSequence mText;
private int mIndex;
private long mDelay = 150; //Default 150ms delay
@Antarix
Antarix / UnzipUtility.java
Created Oct 17, 2014
Unzip utility for Android
View UnzipUtility.java
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
* This utility extracts files and directories of a standard zip file to
@Antarix
Antarix / SendSMS.java
Created Aug 23, 2013
Send SMS in android with delivery report
View SendSMS.java
//---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);
@Antarix
Antarix / XMLParser.java
Created Feb 6, 2013
Load XML data from Url
View XMLParser.java
package com.topchart;
import java.io.IOException;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@Antarix
Antarix / LocalBroadcastExampleActivity.java
Created Dec 26, 2013
Simple Example of using LocalBroadcastManager in Android
View LocalBroadcastExampleActivity.java
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@Antarix
Antarix / GetSample.html
Created Aug 31, 2016
Get json test html
View GetSample.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
@Antarix
Antarix / layout_border_bottom
Created Feb 3, 2013
Setting specific border i.e top,bottom,left,right or all for Android layout
View layout_border_bottom
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:shape="rectangle">
<!-- Set the border color of your layout here -->
<stroke android:width="1dp" android:color="#3AFB03" />
<solid android:color="#3AFB03" />
</shape>
@Antarix
Antarix / iOS_open_settings_cheatsheet.md
Last active Oct 28, 2020
iOS cheat sheet for opening specific phone setting from application
View iOS_open_settings_cheatsheet.md

Cheat sheet for opening specific setting from your application

Swift

UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General")!)

Objective-C

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General"]];
@Antarix
Antarix / gitflow-breakdown.md
Created Jan 16, 2019 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository