View Base64.java
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) { |
View MainActivity.java
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.autolinks; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v7.app.AppCompatActivity; | |
import android.text.SpannableString; | |
import android.text.style.URLSpan; | |
import android.util.Log; | |
import android.view.View; |
View apply.groovy
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' |
View depends.groovy
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' |
View task.groovy
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() | |
} |
View checkstyle.xml
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> |
View unformatted.java
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; | |
} |
View output1
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’. |
View fix.java
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; |
View success-output
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 |
OlderNewer