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"?> | |
<resources> | |
<color name="green">#1abc9c</color> | |
<color name="light_green">#2ecc71</color> | |
<color name="blue">#3498db</color> | |
<color name="deep_purple">#9b59b6</color> | |
<color name="dark_grey">#34495e</color> | |
<color name="deep_green">#27ae60</color> | |
<color name="deep_blue">#2980b9</color> | |
<color name="yellow">#f1c40f</color> |
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
// Install-Package Unity | |
public class UnityResolver : IDependencyResolver | |
{ | |
protected IUnityContainer Container; | |
public UnityResolver(IUnityContainer container) | |
{ | |
if (container == null) | |
{ | |
throw new ArgumentNullException("container"); |
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
To do TDD in Android, I personally use all of the following: | |
FEST-android: FEST assertions for Android | |
Mockito: Mocking Framework | |
Robolectric: Unit testing framework that runs without the need of Android emulator | |
Robotium: UI tests (Needs emulator or device to run) | |
Also: Using dependency injection libraries such as Dagger or Roboguice will greatly simplify your unit/integration tests. To run tests on multiple devices, consider using Spoon. |
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
{ | |
"Codigo": "22123222000222", // CNPJ ou CPF sem pontos ou traços | |
"Nome": "MEU CLIENTE LTDA ME", // Razão social | |
"Fantasia": "Meu Cliente", // Fantasia | |
"Endereco": "Rua 22", | |
"NumEnder": 22, // Numero | |
"Complemento": "Casa", | |
"Bairro": "Centro", | |
"Cidade": "Itapmea", | |
"Uf": "SC", |
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
{ | |
"ClienteId": "0000000000001000", | |
"DataAbertura": "2015-02-19", | |
"VendedorId": 1, | |
"Produtos": [ | |
{ | |
"Codigo":"0000000000642", | |
"Descricao": "LICENÇA USO SOFTWARE( VINCULADO A MENSALIDADE)", | |
"Unitario": 2.00, | |
"Total": 4.00, |
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
// get download directory | |
File imgFile = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); | |
if(imgFile.exists()) { | |
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getPath() + "/ovo.jpg"); | |
ivImagem.setImageBitmap(myBitmap); | |
} | |
} |
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
// Remove o XML | |
var formatters = config.Formatters; | |
formatters.Remove(formatters.XmlFormatter); | |
// Modifica a identação | |
var jsonSettings = formatters.JsonFormatter.SerializerSettings; | |
jsonSettings.Formatting = Formatting.Indented; | |
jsonSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
// Modifica a serialização |
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 AssertionConcern { | |
public static void AssertArgumentEquals(Object object1, Object object2, String message) throws InvalidObjectException | |
{ | |
if (!object1.equals(object2)) { | |
throw new InvalidObjectException(message); | |
} | |
} | |
public static void AssertArgumentFalse(boolean boolValue, String message) throws InvalidObjectException |
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
<connectionStrings> | |
<add name="DatabaseConnectionString" connectionString="server=MEUSERVER;user id=MEUUSER;password=MEUPASS;persistsecurityinfo=True;database=gsn" providerName="MySql.Data.MySqlClient" /> | |
</connectionStrings> |
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
buildscript { | |
repositories { | |
} | |
dependencies { | |
} | |
} | |
repositories { | |
maven { | |
url "https://jitpack.io" |