Skip to content

Instantly share code, notes, and snippets.

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
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
@moulichandu
moulichandu / FbLoginActivity
Created Nov 16, 2016 — forked from vishalpawale/FbLoginActivity
Skeleton for login into Facebook
View FbLoginActivity
package com.sudosaints.android;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
@moulichandu
moulichandu / MediaPlayerStateWrapper.java
Created Aug 5, 2016 — forked from bitops/MediaPlayerStateWrapper.java
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
View MediaPlayerStateWrapper.java
import java.io.IOException;
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;
import android.media.AudioManager;
import android.media.MediaPlayer;
@moulichandu
moulichandu / Activity1.cs
Created Jul 29, 2016 — 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
moulichandu / ColorUtil
Created Jul 29, 2016 — forked from martintreurnicht/ColorUtil
Lighten and darken colors in android
View ColorUtil
public static int lighten(int color, double fraction) {
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
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
moulichandu / AndroidManifest.xml
Created Mar 29, 2016 — 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="http://schemas.android.com/apk/res/android"
package="xxxx.xxxx.xxxx.fragmentdeyoutube" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@moulichandu
moulichandu / gist:1249b4dc556884ecba7f
Created Feb 22, 2016 — 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
moulichandu / DashboardLayout.java
Created Dec 17, 2015 — forked from romannurik/DashboardLayout.java
A custom Android layout class that arranges children in a grid-like manner, optimizing for even horizontal and vertical whitespace.
View DashboardLayout.java
/*
* ATTENTION:
*
* This layout is now maintained in the `iosched' code.google.com project:
*
* http://code.google.com/p/iosched/source/browse/android/src/com/google/android/apps/iosched/ui/widget/DashboardLayout.java
*
*/
/*
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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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) {