Skip to content

Instantly share code, notes, and snippets.

View lamprosg's full-sized avatar

Lampros Giampouras lamprosg

  • Athens, Greece
View GitHub Profile
@lamprosg
lamprosg / couchbase-lite.txt
Last active August 29, 2015 13:58
Couchbase list (iOS - Android)
Documentation
http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/manager/index.html
@lamprosg
lamprosg / cell.m
Created March 11, 2014 10:16
(iOS) swippable uitableviewcell with buttons under
// - SWTableViewCell
//https://github.com/CEWendel/SWTableViewCell
@lamprosg
lamprosg / DeviceID.java
Last active January 2, 2016 14:28
(Android) get device id
public class DeviceID {
private static String sID = null;
private static final String INSTALLATION = "INSTALLATION";
public synchronized static String id(Context context) {
if (sID == null) {
File installation = new File(context.getFilesDir(), INSTALLATION);
try {
if (!installation.exists())
writeInstallationFile(installation);
@lamprosg
lamprosg / MapFragment.java
Last active December 28, 2015 18:29
(Android) Map fragment
package gr.atc.radical.Fragments;
import gr.atc.radical.R;
import gr.atc.radical.Model.POI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.annotation.SuppressLint;
@lamprosg
lamprosg / 0.XYGRaph.h
Last active December 19, 2015 12:29
(iOS) Using Core-Plot
#import "CorePlot-CocoaTouch.h"
@interface CorePlotExampleViewController : ViewController <CPTPlotDataSource>
@end
@lamprosg
lamprosg / byCode.mm
Last active December 19, 2015 02:29
(iOS) Content Views
//Add a content view to your view controller
#import "CenterViewController.h"
@interface MainViewController <CenterControllerDelegate>
@property (nonatomic, strong) CenterViewController *centerViewController;
@end
@lamprosg
lamprosg / 1.animations.java
Last active December 6, 2017 22:51
(Android) Animations
//http://developer.android.com/guide/topics/graphics/prop-animation.html
/*
There’s 3 basic ways in Android to create Animations and we will cover them all here:
- ObjectAnimator
- TweenedAnimations
- XML Declared Animations
*/
//Animating View with Object Animator
@lamprosg
lamprosg / 1.manifest.xml
Last active December 17, 2015 17:09
(Android) Action Bar
<!--
Beginning with Android 3.0 (API level 11), the action bar is included in all activities that use the Theme.Holo theme
(or one of its descendants), which is the default theme when either the targetSdkVersion or minSdkVersion attribute
is set to "11" or greater.
-->
<!-- Example -->
<manifest ... >
<uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="11" />
@lamprosg
lamprosg / 1.standardNotification.java
Last active December 17, 2015 15:59
(Android) Notifications
/* http://developer.android.com/guide/topics/ui/notifiers/notifications.html
*/
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("My notification")
.setContentText("Hello World!");
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(this, yourAppActivity.class);
@lamprosg
lamprosg / 1.AndroidManifest.xml
Last active December 17, 2015 14:59
(Android) Basic use of Locations & Google Maps
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
....
.
.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- network-based location provider only -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- GPS -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- Use the internet -->
.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- If we need it -->