Skip to content

Instantly share code, notes, and snippets.

private void sendInfoToServer(int serverId) {
sendCount = 0;
final File logFile = new File(Environment.getExternalStorageDirectory(), "/temp/statist/logs.txt");
if (!logFile.exists())
return;
final JSONArray jsonToSendArray = new JSONArray();
try {
FileInputStream inputStream = new FileInputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/temp/statist/logs.txt");
if (inputStream != null) {
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
package com.statist.grap;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
package com.example.wwwithscrolltest;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
package com.example.wwwithscrolltest;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.EditText;
import android.widget.ScrollView;
public final class CustomScrollView extends ScrollView {
public EditText title;
package com.example.wwwithscrolltest;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
public class MainActivity extends Activity {
WebView wv;
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffff" >
<com.example.wwwithscrolltest.CustomScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent" >
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
WebTitle webTitle = mBrowser.getTabsActionBar().getTitle();
if (t > oldt) {
Tracer.debug("SCROLL", "tbar = " + webTitle.getY() + " t height = " + webTitle.getHeight());
if (-(webTitle.getY() - (t - oldt)) > webTitle.getHeight())
webTitle.setTranslationY(-webTitle.getHeight());
else
webTitle.setY(webTitle.getY() - (t - oldt));
public class Generator {
private static final Map<byte[], byte[]> cache = new HashMap<byte[], byte[]>();
public static byte[] generate(byte[] src) {
byte[] generated = cache.get(src);
if (generated == null) {
synchronized (cache) {
generated = cache.get(src);
if (generated == null) {
generated = doGenerate(src);
package net.firepush.adnet {
import flash.external.ExtensionContext;
public class FirePushExtension {
private static var context:ExtensionContext;
public static function init():void {
if(!context) context = ExtensionContext.createExtensionContext("net.firepush.adnet.FirePushLib", null);
package net.firepush.adnet;
import android.content.Context;
import android.util.Log;
import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
public class ShowBannerFunction implements FREFunction{
@Override
public FREObject call(FREContext context, FREObject[] args) {