Skip to content

Instantly share code, notes, and snippets.

View moulichandu's full-sized avatar

Chandramouli moulichandu

  • Hyderabad,India
View GitHub Profile
View Install Android emulator on Ubuntu and run the Ionic app on mobile
1. install openjdk
`sudo apt-get install openjdk-7-jdk`
2. install `android sdk`
# download android sdk
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
moulichandu / FbLoginActivity
Created November 16, 2016 11:28 — forked from vishalpawale/FbLoginActivity
Skeleton for login into Facebook
View FbLoginActivity
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.content.Intent;
moulichandu /
Created August 5, 2016 09:08 — forked from bitops/
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
import java.lang.reflect.Method;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
moulichandu / Activity1.cs
Created July 29, 2016 15:27 — forked from Cheesebaron/Activity1.cs
Sample showing how to use Spannables to replace text with Images in Mono for Android.
View Activity1.cs
using Android.App;
using Android.Text;
using Android.Text.Style;
using Android.Widget;
using Android.OS;
namespace MonoDroid.TextViewWithImages
[Activity(Label = "Text with Images", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
moulichandu / ColorUtil
Created July 29, 2016 12:06 — forked from martintreurnicht/ColorUtil
Lighten and darken colors in android
View ColorUtil
public static int lighten(int color, double fraction) {
int red =;
int green =;
int blue =;
red = lightenColor(red, fraction);
green = lightenColor(green, fraction);
blue = lightenColor(blue, fraction);
int alpha = Color.alpha(color);
return Color.argb(alpha, red, green, blue);
moulichandu / AndroidManifest.xml
Created March 29, 2016 09:32 — forked from takeshiyako2/AndroidManifest.xml
Android Sample YouTube API on the Fragment
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
package="xxxx.xxxx.xxxx.fragmentdeyoutube" >
<uses-permission android:name="android.permission.INTERNET" />
moulichandu / gist:1249b4dc556884ecba7f
Created February 22, 2016 09:32 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
View gist:1249b4dc556884ecba7f
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
moulichandu /
Created December 17, 2015 14:22 — forked from romannurik/
A custom Android layout class that arranges children in a grid-like manner, optimizing for even horizontal and vertical whitespace.
* This layout is now maintained in the `iosched' project:
View gist:9847ab4a9126e36c11b0
* Copyright (C) 2010 Neil Davies
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
View whatsapp-image-compression
- (UIImage *)compressImage:(UIImage *)image{
float actualHeight = image.size.height;
float actualWidth = image.size.width;
float maxHeight = 600.0;
float maxWidth = 800.0;
float imgRatio = actualWidth/actualHeight;
float maxRatio = maxWidth/maxHeight;
float compressionQuality = 0.5;//50 percent compression
if (actualHeight > maxHeight || actualWidth > maxWidth) {