This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShakeActivity extends Activity { | |
private SensorManager mSensorManager; | |
private ShakeEventListener mSensorListener; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Listener that detects shake gesture. | |
*/ | |
public class ShakeEventListener implements SensorEventListener { | |
/** Minimum movement force to consider. */ | |
private static final int MIN_FORCE = 12; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SplashActivity extends Activity { | |
// Tempo que a activity vai aparecer em milisegundos | |
private static int SPLASH_TIME_OUT = 2000; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_splash); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GCMIntentService extends GCMBaseIntentService { | |
private int count = 0; | |
public GCMIntentService() { | |
super(GCM.SENDER_ID); | |
} | |
/** | |
* Method called on device registered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GCM { | |
static final String TAG = "GCMService"; | |
static final String SENDER_ID = "XXXXXXXXXXXX"; | |
public static String regId; | |
public static void ativa(Context context){ | |
GCMRegistrar.checkDevice(context); | |
GCMRegistrar.checkManifest(context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('BASEPATH')) | |
exit('No direct script access allowed'); | |
class Welcome extends CI_Controller { | |
public function __construct() { | |
parent::__construct(); | |
$this->load->model('user_model', 'user'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE public.ci_sessions ( | |
session_id VARCHAR(40) DEFAULT '0'::character varying NOT NULL, | |
ip_address VARCHAR(16) DEFAULT '0'::character varying NOT NULL, | |
user_agent VARCHAR(150) NOT NULL, | |
last_activity INTEGER DEFAULT 0 NOT NULL, | |
user_data TEXT NOT NULL, | |
CONSTRAINT ci_sessions_pkey PRIMARY KEY(session_id) | |
) WITHOUT OIDS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('.telefone').focusout(function(){ | |
var phone, element; | |
element = $(this); | |
element.unmask(); | |
phone = element.val().replace(/\D/g, ''); | |
if(phone.length > 10) { | |
element.mask("(99) 99999-999?9"); | |
} else { | |
element.mask("(99) 9999-9999?9"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE mantis_config_table ( | |
config_id VARCHAR(64) NOT NULL, | |
project_id INTEGER NOT NULL DEFAULT 0, | |
user_id INTEGER NOT NULL DEFAULT 0, | |
access_reqd INTEGER DEFAULT 0, | |
type INTEGER DEFAULT 90, | |
value LONGTEXT NOT NULL, | |
PRIMARY KEY (config_id, project_id, user_id) | |
)ENGINE=MyISAM DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Layout xml | |
*/ | |
<com.loopj.android.image.SmartImageView android:id="@+id/image_test" /> | |
/* | |
* Activity | |
*/ | |
SmartImageView img = (SmartImageView) vi.findViewById(R.id.image_test); | |
img.setImageUrl("http://www.itau.com.br/_arquivosestaticos/Itau/defaultTheme/img/logo-itau.png"); |