Skip to content

Instantly share code, notes, and snippets.

View msomu's full-sized avatar

Somasundaram M msomu

View GitHub Profile
@msomu
msomu / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
@msomu
msomu / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
@msomu
msomu / mainactivity.java
Created November 24, 2014 07:07
Back button double press
private static long back_pressed;
@Override
public void onBackPressed()
{
if (back_pressed + 2000 > System.currentTimeMillis()) super.onBackPressed();
else Toast.makeText(getBaseContext(), "Press once again to exit!", Toast.LENGTH_SHORT).show();
back_pressed = System.currentTimeMillis();
}
@msomu
msomu / HomeActivity.java
Created November 20, 2014 11:13
Fetch the data from website using AsyncTask in Android
public class HomeActivity extends ActionBarActivity {
String fetchurl = "http://www.vogella.com";
TextView tvBasicView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
init();
@msomu
msomu / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@msomu
msomu / Activity.java
Created November 12, 2014 15:38
Read Call Logs in Android
private void getCallDetails() {
StringBuffer sb = new StringBuffer();
Cursor managedCursor = managedQuery(CallLog.Calls.CONTENT_URI, null, null, null, null);
int number = managedCursor.getColumnIndex(CallLog.Calls.NUMBER);
int type = managedCursor.getColumnIndex(CallLog.Calls.TYPE);
int date = managedCursor.getColumnIndex(CallLog.Calls.DATE);
int duration = managedCursor.getColumnIndex(CallLog.Calls.DURATION);
sb.append("Call Log :");
while (managedCursor.moveToNext()) {
String phNumber = managedCursor.getString(number);
@msomu
msomu / AndroiManifest.xml
Last active August 29, 2015 14:09
Get the user Email id without even saying the user.
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
@msomu
msomu / main.css
Created November 10, 2014 14:25
To make the image background full in HTML page
html {
background: url(www/images/background.gif) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@msomu
msomu / enterinfo.html
Last active August 29, 2015 14:09
This is a PHP simple file that sends data from html to php
<html>
<head>
<title>
This is an php tutorial
</title>
</head>
<body>
<form action="learnphp.php" method="post">
<table border="0">
<tr>
@msomu
msomu / MyActivity.java
Created November 1, 2014 05:25
Button click using ClickListener
public class MyActivity extends ActionBarActivity implements View.OnClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Log.d("SOMU","On Create called");
setContentView(R.layout.activity_my);
one = (Button) findViewById(R.id.button1);
one.setOnClickListener(this);
}
}