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{ |
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
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.smallplanet.android.planned.drawable; | |
import android.graphics.Canvas; | |
import android.graphics.ColorFilter; | |
import android.graphics.Paint; | |
import android.graphics.drawable.Drawable; | |
import android.view.View; | |
/** | |
* Created by JBruchanov on 21/09/2015. |
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
- (void)uploadImage:(UIImage*) image { | |
/* | |
turning the image into a NSData object | |
getting the image back out of the UIImageView | |
setting the quality to 90 | |
*/ | |
NSData *imageData = UIImageJPEGRepresentation(image, 90); | |
// setting up the URL to post to | |
NSString *urlString = @"http://www.scurab.com/ios.php"; | |
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
/* | |
http://developer.android.com/reference/android/app/Application.html#registerActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks) | |
Helper for counting running activities to send request if we are going from background | |
*/ | |
private ActivityLifecycleCallbacks mActivityLifecycleCallbacks = new ActivityLifecycleCallbacks() { | |
private int mActivityCounter; | |
@Override public void onActivityResumed(Activity activity) { } | |
@Override public void onActivityPaused(Activity activity) { } | |
@Override public void onActivitySaveInstanceState(Activity activity, Bundle outState) { } |
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.smallplanet.android.birdsandbees.math; | |
import android.graphics.PointF; | |
/** | |
* Created by JBruchanov on 04/11/2015. | |
*/ | |
public class Line implements Comparable<Line> { | |
private PointF mPoint1; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Data xmlns="http://schema.smallplanet.com/WallArt"> | |
<Furniture image="sofa1.png" width="97" /> | |
<Furniture image="bedroom2.png" width="116" /> | |
<Furniture image="dining1.png" width="118" /> | |
<Furniture image="office1.png" width="77" /> | |
<Furniture image="bedroom1.png" width="90" /> | |
<Furniture image="bedroom3.png" width="103" /> | |
<Furniture image="dining3.png" width="125" /> |
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
public class MyActivity extends Activity implements PBarChange { | |
private ProgressBar mPbar; | |
private MyThread mMyThread; | |
public void onCreate(...){ | |
super.onCreate(...); | |
setContentView(R.id.content); | |
mPbar = (ProgressBar)findViewById(R.id.pbar); |
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
#install oracle java https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get | |
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer | |
#ANDROIDSTUDIO | |
#necessary for mksdcard | |
sudo apt-get install lib32stdc++6 |
OlderNewer