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 MainActivity extends AppCompatActivity { | |
@Inject | |
ExemploContrato exemplo; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
MainApplication.getComponent().inject(this);// informando ao dagger sobre o uso de um component e a necessidade de injetar dependência | |
List<Pedido> pedidos = exemplo.listaPedidosUsuario(); |
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
@Module | |
public class ClassModule { | |
@Provides | |
public UsuarioContrato proverUsuario() { | |
return new Usuario(); | |
} | |
@Provides | |
public ExemploContrato proverExemplo(UsuarioContrato usuario) { |
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
Usuario usuario = new Usuario(); | |
Exemplo exemplo = new Exemplo(usuario); |
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 Exemplo { | |
public List<Pedido> listarPedidosUsuario() { | |
Usuario usuario = new Usuario(); | |
return usuario.listarPedidos(); | |
} | |
} |
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 Exemplo implements ExemploContrato { | |
private UsuarioContrato usuario; | |
public Exemplo(UsuarioContrato usuario) { | |
this.usuario = usuario; | |
} | |
@Override | |
public List<Pedido> listaPedidosUsuario() { | |
return usuario.listarPedidos(); |
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
Firebase refUsers1 = new Firebase("https://medreportapp.firebaseio.com/users").child("androidjam@mail,com"); | |
Map<String, Boolean> hm = new HashMap<>(); | |
hm.put("Teste", true); | |
refUsers1.addChildEventListener(new ChildEventListener() { | |
@Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { | |
Log.d("TAG", dataSnapshot.toString()+" - Key: "+dataSnapshot.getKey()); | |
} |
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
Firebase firebase = new Firebase("https://medreportapp.firebaseio.com/users"); | |
Query queryRef = firebase.orderByChild("email").equalTo(edit.getText().toString()); | |
queryRef.addListenerForSingleValueEvent(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
Log.i("key", dataSnapshot.getKey()); | |
dataSnapshot.getRef().getKey(); | |
User user = dataSnapshot.getValue(User.class); | |
// Log.i("email", user.getEmail()); | |
// Log.i("name", user.getName()); |
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 java.util.Scanner; | |
import java.io.IOException; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
// TODO Auto-generated method stub | |
Scanner sc = new Scanner(System.in); | |
int n = sc.nextInt(); | |
for (int i = 0; i < n; i++) { | |
String diamantes = sc.next(); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:weightSum="10" |
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
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class | |
# built native files (uncomment if you build your own) | |
# *.o | |
# *.so |