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" standalone="no"?> | |
<profiles version="12"> | |
<profile kind="CodeFormatterProfile" name="Eclipse Alessio" version="12"> | |
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> | |
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/> | |
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> | |
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> | |
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> | |
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> | |
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> |
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 com.animatedpiechart; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.ViewGroup; | |
import android.view.animation.AccelerateDecelerateInterpolator; | |
import android.view.animation.Interpolator; | |
import android.widget.LinearLayout; |
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 cx.ath.venator.semaphorehandler; | |
import java.util.Vector; | |
import android.os.Handler; | |
import android.os.Message; | |
/** | |
* Message Handler class that supports buffering up of messages when the | |
* activity is paused i.e. in the background. |
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 com.example.provaandroid; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import com.squareup.otto.Bus; | |
import com.squareup.otto.Produce; | |
import com.squareup.otto.Subscribe; |
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.content.Context; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.util.AttributeSet; | |
import android.widget.Checkable; | |
import android.widget.CompoundButton; | |
import android.widget.ImageView; | |
public class CheckableImageView extends ImageView implements Checkable { |
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 MyPagerAdapter extends PagerAdapter { | |
private final List<View> pages; | |
public MyPagerAdapter(List<View> pages) { | |
super(); | |
this.pages = pages; | |
} | |
@Override |
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 org.junit.runners.model.InitializationError; | |
import org.robolectric.RobolectricTestRunner; | |
import org.robolectric.annotation.Config; | |
import org.robolectric.internal.bytecode.InstrumentationConfiguration; | |
import org.robolectric.manifest.AndroidManifest; | |
import org.robolectric.res.FileFsFile; | |
import org.robolectric.res.FsFile; | |
public class LibraryProjectTestRunner extends RobolectricTestRunner { |
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 com.example.alessio.testapp; | |
import android.content.Context; | |
import android.content.pm.ApplicationInfo; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.security.cert.CertificateFactory; | |
import java.security.cert.X509Certificate; | |
import java.util.zip.ZipEntry; |
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 void validateCertificate(X509Certificate toVerify, X509Certificate root) throws Exception { | |
CertificateFactory cf = CertificateFactory.getInstance("X.509"); | |
CertPath cp = cf.generateCertPath(Collections.singletonList(toVerify)); | |
TrustAnchor trustAnchor = new TrustAnchor(root, null); | |
CertPathValidator cpv = CertPathValidator.getInstance("PKIX"); | |
PKIXParameters pkixParams = new PKIXParameters(Collections.singleton(trustAnchor)); | |
pkixParams.setRevocationEnabled(false); |
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
fold() { | |
data="$1" | |
width="$2" | |
length=$(echo -n "$data" | wc -c) | |
while [ $length -gt $width ] | |
do | |
echo ${data:0:$width} | |
data=${data:$width} | |
length=$(echo -n "$data" | wc -c) | |
done |
OlderNewer