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 static String encodeBase64(String path) { | |
try { | |
File file = new File(path); | |
FileInputStream imageInFile = new FileInputStream(file); | |
byte imageData[] = new byte[(int) file.length()]; | |
imageInFile.read(imageData); | |
imageInFile.close(); | |
return Base64.encodeToString(imageData, Base64.DEFAULT); | |
} catch (Exception e) { |
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
apply plugin: 'checkstyle' |
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
check.dependsOn 'checkstyle' |
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
task checkstyle(type: Checkstyle) { | |
configFile file("$project.rootDir/config/checkstyle/checkstyle.xml") | |
source 'src' | |
include '**/*.java' | |
classpath = files() | |
} |
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"?> | |
<!DOCTYPE module PUBLIC | |
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
<module name="Checker"> | |
<module name="TreeWalker"> | |
<module name="GenericWhitespace" /> | |
</module> |
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
package net.rafaeltoledo.codequality; | |
import android.support.v7.app.AppCompatActivity; | |
import java.util.List; | |
public class MyActivity extends AppCompatActivity { | |
List< String > myList; | |
} |
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
Executing external task ‘checkstyle’… | |
Parallel execution is an incubating feature. | |
[ant:checkstyle] [...]MyActivity.java:9:10: ‘<’ é seguido de espaço em branco. | |
[ant:checkstyle] [...]MyActivity.java:9:17: ‘>’ é precedido por espaço em branco. | |
:app:checkstyle FAILED | |
FAILURE: Build failed with an exception. | |
* What went wrong: | |
Execution failed for task ‘:app:checkstyle’. |
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
List<String> myList; |
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
Executing external task ‘checkstyle’… | |
Parallel execution is an incubating feature. | |
:app:checkstyle | |
BUILD SUCCESSFUL | |
Total time: 2.622 secs |
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
apply plugin: 'findbugs' |
OlderNewer