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
Gerar key SSH | |
ssh-keygen -t rsa -C "your_email@example.com" | |
Copiar conteúdo do arquivo | |
cat ~/.ssh/id_rsa.pub | |
Como configurar o Git | |
https://help.github.com/articles/set-up-git | |
Copiar o conteúdo do arquivo e deixar no Ctrl+C |
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
//Método deve ser inserido na Activity que deseja a animação | |
private void configurarAnimacaoLoading() { | |
ImageView img = (ImageView) findViewById(R.id.img_gif); | |
AnimationDrawable frameAnimation = (AnimationDrawable) img.getDrawable(); | |
frameAnimation.setCallback(img); | |
frameAnimation.setVisible(true, true); //(visible, restart) | |
frameAnimation.start(); | |
} |
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
//---------------------------------- Fazer ligação | |
Button btnnum; | |
btnnum = ((Button) this.findViewById(R.id.btnnumdetalhe)); | |
btnnum.setText(telefone.getDetalheuteis()); | |
btnnum.setOnClickListener(new OnClickListener() { | |
public void onClick(View v) { | |
Intent chamada = new Intent(Intent.ACTION_CALL); | |
chamada.setData(Uri.parse("tel:" + telefone.getDetalheuteis())); | |
startActivity(chamada); | |
} |
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
Adicionar o xml da ProgressBar onde você quer que ela apareça. | |
<ProgressBar | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
style="@android:style/Widget.ProgressBar.Horizontal" | |
android:indeterminateBehavior="repeat" | |
android:indeterminate="true" | |
android:layout_marginRight="5dp" | |
/> |
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
import android.view.animation.LinearInterpolator; | |
import android.view.animation.TranslateAnimation; | |
import android.widget.ImageView; | |
public class Animacao { | |
public static Integer ANIM_INICIO = 0; | |
public static Integer ANIM_FIM = 1; | |
public static Integer FRENTE = 1; | |
public static Integer MEIO = 2; | |
public static Integer FUNDO = 3; |
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
//Em Activity | |
Intent i = new Intent(MainActivity.this, Destino.java); | |
startActivity(i); | |
overridePendingTransition(R.anim.fadein, R.anim.fadeout); | |
// Em fragments (provavelmente já possúi um código parecido com este) | |
FragmentManager fragmentManager = getSupportFragmentManager(); | |
FragmentTransaction transaction = fragmentManager.beginTransaction(); | |
transaction.setCustomAnimations(R.anim.fadein, R.anim.fadeout); //animação aqui | |
transaction.commit(); |
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
1. Abra o prompt e cole o seguinte comando: | |
keytool -exportcert -alias androiddebugkey -keystore path_to_debug_or_production_keystore -list -v | |
2. Se for necessário digitar alguma senha, ela é: 'android' |
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 BrowsePicture extends Activity { | |
private static final int SELECT_PICTURE = 1; | |
private String selectedImagePath; | |
private String filemanagerstring; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); |
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
private void configAdMob() { | |
mAdView = (AdView) findViewById(R.id.adView); | |
mAdView.loadAd(new AdRequest.Builder().build()); //comentar quando usar a versão de debug | |
//Configura o admob para versão de debug, comentar quando colocar o app em produção | |
/*AdRequest adRequest = new AdRequest.Builder() | |
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR) // Emulador | |
.addTestDevice("213551FAC446BEC3532E8E65DC961F49") //Código do device | |
.build(); | |
mAdView.loadAd(adRequest);*/ |
OlderNewer