This file contains hidden or 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
HttpURLConnection hc = (HttpURLConnection) connection; | |
HttpsURLConnection huc = (HttpsURLConnection) hc; | |
huc.setHostnameVerifier(mHostnameVerifier); | |
huc.setSSLSocketFactory(initSSLSocketFactory(new FakeTrustManager())); | |
private SSLSocketFactory initSSLSocketFactory(manager) | |
throws KeyManagementException, NoSuchAlgorithmException { | |
// Install the all-trusting trust manager | |
final SSLContext sslContext = SSLContext.getInstance("SSL"); | |
sslContext.init(null, new TrustManager[]{manager}, |
This file contains hidden or 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.scurab.android.anuitor.reflect; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.os.Build; | |
import android.view.View; | |
import java.lang.reflect.Method; | |
import java.util.ArrayList; |
This file contains hidden or 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
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); | |
g.setFont(new Font("Arial", Font.PLAIN, 24)); | |
FontMetrics fm = g.getFontMetrics(); | |
TextRenderHelper helper = new TextRenderHelper(fm, "Hello World\nHello World Hello World Hello World Hello World", 300, 60); | |
for (TextRenderHelper.LineRenderContext lrc : helper.prepareForRender(TextRenderHelper.Gravity.CENTER, TextRenderHelper.Gravity.CENTER)) { | |
g.drawString(lrc.text, lrc.x, lrc.y); | |
} | |
private static class TextRenderHelper{ |
NewerOlder