Skip to content

Instantly share code, notes, and snippets.

<declare-styleable name="MinhaCustomView">
<attr name="atributo_um"/>
<attr name="atributo_dois" format="boolean"/>
<attr name="atributo_tres" format="string" />
</declare-styleable>
adb shell monkey [options] <event-count>
adb shell monkey -p com.tumblr.juliozynger.apptestermonkey -v 2000
@julioz
julioz / gist:5526123
Created May 6, 2013 16:10
adb server restart
adb kill-server
adb start-server
ACLMessage msg = new ACLMessage(ACLMessage.INFORM);
msg.addReceiver(new AID("Julio", AID.ISLOCALNAME);
msg.setLanguage("Portugues");
msg.setContent("Olá mundo! Esta é minha primeira ACLMessage!");
send(msg);
ACLMessage msg = receive();
if (msg != null) {
// Processar a mensagem
String conteudo = msg.getContent();
System.out.println(conteudo);
// imprimirá "Olá mundo! Esta é minha primeira ACLMessage!"
// no caso da mensagem https://gist.github.com/julioz/5736814
}
@julioz
julioz / build.gradle
Created April 27, 2016 00:30
Android publisher gradle dependency
compile 'com.google.apis:google-api-services-androidpublisher:v2-rev24-1.21.0'
@julioz
julioz / ContinuousDeployDemo.java
Created April 27, 2016 00:31
GoogleCredential instantiation
NetHttpTransport http = GoogleNetHttpTransport.newTrustedTransport();
JacksonFactory json = JacksonFactory.getDefaultInstance();
Set<String> scopes = Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER);
File secretFile = new File(Constants.SECRET_FILE_PATH);
GoogleCredential credential = new GoogleCredential.Builder().
setTransport(http).
setJsonFactory(json).
setServiceAccountPrivateKeyId(Constants.KEY_ID).
NetHttpTransport http = GoogleNetHttpTransport.newTrustedTransport();
JacksonFactory json = JacksonFactory.getDefaultInstance();
GoogleCredential credential = ...
AndroidPublisher publisher = new AndroidPublisher.Builder(http, json, credential).
setApplicationName(PACKAGE).
build();