1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-12-26 06:45:33 +00:00

Removed temp folder.

This commit is contained in:
Fabian Schlenz 2016-06-29 10:59:58 +02:00
parent 53d2b1674f
commit 2ccdff9d87
39 changed files with 0 additions and 1303 deletions

View File

@ -1,7 +0,0 @@
actors/build
actors-sample/build
.idea
.gradle
*.iml
local.properties

View File

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,81 +0,0 @@
DroidKit Actors
===============
Lightweight java implementation of actor model for small applications. Designed for Android applications.
Read more about actors on [Wikipedia](http://en.wikipedia.org/wiki/Actor_model)
QuickStart
===============
### Add dependency to your gradle project
```
compile 'com.droidkit:actors:0.1.+'
```
### Create log Actor
```
import android.util.Log;
import com.droidkit.actors.Actor;
public class LogActor extends Actor {
@Override
public void preStart() {
Log.d("LOGACTOR#" + hashCode(), "preStart");
}
@Override
public void onReceive(Object message) {
Log.d("LOGACTOR#" + hashCode(), message + "");
}
@Override
public void postStop() {
Log.d("LOGACTOR#" + hashCode(), "postStop");
}
}
```
### Use main actor system
Actor system is entry point to actor model, it contains all configurations, dispatchers and actors.
Dispatcher is a queue + worker threads for this queue.
By default ActorSystem has static main ActorSystem and in most cases you can use it in two ways:
```
void a() {
ActorSystem.system()
}
```
or
```
import static com.droidkit.actors.ActorSystem.system;
void a() {
system()
}
```
### or create your Actor system
```
ActorSystem system = new ActorSystem();
// Add additional dispatcher with threads number == cores count
system.addDispatcher("images");
// Add additional dispather with 3 threads with minimal priority
system.addDispatcher("images", new MailboxesDispatcher(system, 2, Thread.MIN_PRIORITY));
```
### Complete sample
```
system().addDispatcher("images", new MailboxesDispatcher(system(), 2, Thread.MIN_PRIORITY));
ActorRef log1 = system().actorOf(LogActor.class, "log");
ActorRef log2 = system().actorOf(LogActor.class, "log");
ActorRef log3 = system().actorOf(Props.create(LogActor.class).changeDispatcher("images"), "log2");
ActorRef log4 = system().actorOf(Props.create(LogActor.class).changeDispatcher("images"), "log3");
ActorRef[] refs = new ActorRef[]{log1, log2, log3, log4};
for (int i = 0; i < 100; i++) {
refs[i % refs.length].send("test" + i);
}
```
Log output will be with messages without ordering across all messages, but ordered for every actor.
License
===============
License use [MIT License](LICENSE)

View File

@ -1,130 +0,0 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
apply plugin: 'android-library'
apply plugin: 'maven'
apply plugin: 'signing'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public/" }
}
sourceCompatibility = 1.6
group = 'com.droidkit'
version = fullVersion
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
}
// Android JavaDocs
android.libraryVariants.all { variant ->
task("${variant.name}Javadoc", type: Javadoc) {
destinationDir = new File("$project.buildDir/javadoc/$variant.name")
source = variant.javaCompile.source
exclude '**/BuildConfig.java'
exclude '**/R.java'
ext.androidJar = "${android.plugin.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
}
task("${variant.name}JavadocJar", type: Jar, dependsOn: "${variant.name}Javadoc") {
classifier 'javadoc'
destinationDir = new File("$project.buildDir/libs/")
from "$project.buildDir/javadoc/$variant.name"
}
task("${variant.name}SourcesJar", type: Jar) {
classifier 'sources'
destinationDir = new File("$project.buildDir/libs/")
from variant.javaCompile.source
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
}
project.afterEvaluate {
artifacts {
archives releaseJavadocJar
archives releaseSourcesJar
}
if (project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")) {
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'DroidKit Actors: Android'
packaging 'aar'
description 'DroidKit Actors: Android is extension for DroidKit Actors for creating UIActors'
url 'https://github.com/secretapphd/droidkit-actors'
scm {
url 'scm:git@github.com:secretapphd/droidkit-actors.git'
connection 'scm:git@github.com:secretapphd/droidkit-actors.git'
developerConnection 'scm:git@github.com:secretapphd/droidkit-actors.git'
}
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'ex3ndr'
name 'Stepan Korshakov'
}
}
}
}
}
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.droidkit:actors:0.2.+'
}

View File

@ -1,17 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/ex3ndr/Documents/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

View File

@ -1,6 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.droidkit.actors.android">
<application></application>
</manifest>

View File

@ -1,85 +0,0 @@
package com.droidkit.actors.android;
import com.droidkit.actors.*;
import com.droidkit.actors.messages.PoisonPill;
import java.util.UUID;
/**
* Actor-like object that works in UI Thread and backed by real Actor that dispatched on UI thread too.
*/
public class UiActor {
private String path;
private ActorSystem actorSystem;
private ActorRef actorRef;
private boolean isKilled;
public UiActor() {
this(ActorSystem.system());
}
public UiActor(ActorSystem actorSystem) {
this.actorSystem = actorSystem;
this.actorRef = actorSystem.actorOf(BackedUiActor.createProps(this), "ui_" + UUID.randomUUID());
this.isKilled = false;
}
/**
* Path of actor
*
* @return Path
*/
public String getPath() {
return path;
}
/**
* Backed ActorRef
*
* @return ActorRef
*/
public ActorRef getActorRef() {
return actorRef;
}
/**
* On incoming message
*
* @param message message
*/
public void onReceive(Object message) {
}
/**
* Stop receiving messages by this actor
*/
public void kill() {
isKilled = true;
actorRef.send(PoisonPill.INSTANCE);
}
private static class BackedUiActor extends Actor {
public static Props<BackedUiActor> createProps(final UiActor uiActor) {
return Props.create(BackedUiActor.class, new ActorCreator<BackedUiActor>() {
@Override
public BackedUiActor create() {
return new BackedUiActor(uiActor);
}
}).changeDispatcher("ui");
}
private UiActor uiActor;
private BackedUiActor(UiActor uiActor) {
this.uiActor = uiActor;
}
@Override
public void onReceive(Object message) {
if (!uiActor.isKilled) {
uiActor.onReceive(message);
}
}
}
}

View File

@ -1,24 +0,0 @@
package com.droidkit.actors.android;
import com.droidkit.actors.ActorSystem;
import com.droidkit.actors.dispatch.Dispatch;
import com.droidkit.actors.mailbox.AbsActorDispatcher;
import com.droidkit.actors.mailbox.Envelope;
import com.droidkit.actors.mailbox.MailboxesQueue;
/**
* Actor Dispatcher for dispatching messages on UI Thread
*/
public class UiActorDispatcher extends AbsActorDispatcher {
public UiActorDispatcher(ActorSystem actorSystem) {
super(actorSystem);
initDispatcher(new UiDispatcher<Envelope, MailboxesQueue>(new MailboxesQueue(), new Dispatch<Envelope>() {
@Override
public void dispatchMessage(Envelope message) {
processEnvelope(message);
}
}));
}
}

View File

@ -1,54 +0,0 @@
package com.droidkit.actors.android;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.droidkit.actors.ActorTime;
import com.droidkit.actors.dispatch.AbstractDispatchQueue;
import com.droidkit.actors.dispatch.AbstractDispatcher;
import com.droidkit.actors.dispatch.Dispatch;
/**
* Thread Dispatcher that dispatches messages on UI Thread
*/
public class UiDispatcher<T, Q extends AbstractDispatchQueue<T>> extends AbstractDispatcher<T, Q> {
private Handler handler = new Handler(Looper.getMainLooper()) {
@Override
public void dispatchMessage(Message msg) {
doIteration();
}
};
protected UiDispatcher(Q queue, Dispatch<T> dispatch) {
super(queue, dispatch);
}
protected void invalidate() {
handler.removeMessages(0);
handler.sendEmptyMessage(0);
}
protected void invalidateDelay(long delay) {
handler.removeMessages(0);
if (delay > 15000) {
delay = 15000;
}
handler.sendEmptyMessageDelayed(0, delay);
}
@Override
protected void notifyDispatcher() {
invalidate();
}
protected void doIteration() {
long time = ActorTime.currentTime();
T action = getQueue().dispatch(time);
if (action == null) {
long delay = getQueue().waitDelay(time);
invalidateDelay(delay);
} else {
dispatchMessage(action);
}
}
}

View File

@ -1,60 +0,0 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public/" }
}
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode apkVersionCode
versionName apkVersionName
}
signingConfigs {
release {
}
}
buildTypes {
release {
signingConfig signingConfigs.release
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
if (project.hasProperty('androidStore') &&
project.hasProperty('androidStorePass') &&
project.hasProperty('androidAliasPass')&&
project.hasProperty('androidAlias')) {
android.signingConfigs.release.storeFile = file(androidStore)
android.signingConfigs.release.storePassword = androidStorePass
android.signingConfigs.release.keyAlias = androidAlias
android.signingConfigs.release.keyPassword = androidAliasPass
} else {
buildTypes.release.signingConfig = null
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
// compile project(":actors-android")
compile project(":actors")
compile project(":actors-android")
}

View File

@ -1,17 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/ex3ndr/Documents/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.droidkit.actors.sample">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.droidkit.actors.sample.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -1,21 +0,0 @@
package com.droidkit.actors.sample;
import com.droidkit.actors.Actor;
/**
* Created by ex3ndr on 27.08.14.
*/
public class CounterActor extends Actor {
int last = -1;
@Override
public void onReceive(Object message) {
if (message instanceof Integer) {
int val = (Integer) message;
if (last != val - 1) {
Log.d("Error! Wrong order expected #" + (last + 1) + " got #" + val);
}
last++;
}
}
}

View File

@ -1,58 +0,0 @@
package com.droidkit.actors.sample;
import com.droidkit.actors.ReflectedActor;
import com.droidkit.actors.tasks.AskCallback;
import com.droidkit.actors.tasks.AskFuture;
/**
* Created by ex3ndr on 18.08.14.
*/
public class DownloadFile extends ReflectedActor {
public void onReceive(String[] url) {
ask(HttpDownloader.download(url[0]));
ask(HttpDownloader.download(url[1]));
AskFuture future = ask(HttpDownloader.download(url[2]));
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
future.cancel();
// combine("downloaded", byte[].class,
// ask(HttpDownloader.download(url[0])),
// ask(HttpDownloader.download(url[1])));
}
public void onDownloadedReceive(byte[][] data) {
Log.d("DownloadFile:onDownloadedReceive:" + data);
Log.d("downloaded " + data[0].length + " bytes and " + data[1].length + " bytes");
}
public void onDownloadedReceive(Throwable throwable) {
Log.d("DownloadFile:onDownloadedReceiveError:" + throwable);
}
public void onReceive(String url) {
Log.d("DownloadFile:onReceiveUrl:" + url);
ask(HttpDownloader.download(url), new AskCallback() {
@Override
public void onResult(Object result) {
self().send(result);
}
@Override
public void onError(Throwable throwable) {
}
});
}
public void onReceive(byte[] data) {
Log.d("DownloadFile:receiveData:" + data);
Log.d("downloaded " + data.length + " bytes");
}
}

View File

@ -1,34 +0,0 @@
package com.droidkit.actors.sample;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Created by ex3ndr on 17.08.14.
*/
public class HashUtil {
public static String md5(String s) {
try {
byte[] bytesOfMessage = s.getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(bytesOfMessage);
return hex(thedigest);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
throw new RuntimeException();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
throw new RuntimeException();
}
}
public static String hex(byte[] data) {
StringBuilder res = new StringBuilder();
for (int i = 0; i < data.length; i++) {
res.append(Integer.toHexString(data[i] & 0xFF).toLowerCase());
}
return res.toString();
}
}

View File

@ -1,73 +0,0 @@
package com.droidkit.actors.sample;
import com.droidkit.actors.*;
import com.droidkit.actors.dispatch.RunnableDispatcher;
import com.droidkit.actors.tasks.TaskActor;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by ex3ndr on 18.08.14.
*/
public class HttpDownloader extends TaskActor<byte[]> {
private static final RunnableDispatcher dispatcher = new RunnableDispatcher(2);
public static String path(String url) {
return "/http_" + HashUtil.md5(url);
}
public static Props<HttpDownloader> prop(final String url) {
return Props.create(HttpDownloader.class, new ActorCreator<HttpDownloader>() {
@Override
public HttpDownloader create() {
return new HttpDownloader(url);
}
});
}
public static ActorSelection download(String url) {
return new ActorSelection(prop(url), path(url));
}
private String url;
private Runnable runnable;
public HttpDownloader(final String url) {
this.url = url;
runnable = new Runnable() {
@Override
public void run() {
try {
Log.d("HttpDownloader:startDownload:" + url);
URL urlSpec = new URL(url);
HttpURLConnection urlConnection = (HttpURLConnection) urlSpec.openConnection();
urlConnection.setConnectTimeout(15000);
urlConnection.setReadTimeout(15000);
InputStream in = urlConnection.getInputStream();
byte[] data = IOUtils.readAll(in);
complete(data);
Log.d("HttpDownloader:complete:" + url);
} catch (IOException e) {
error(e);
Log.d("HttpDownloader:error:" + url);
}
}
};
setTimeOut(500);
}
@Override
public void startTask() {
Log.d("HttpDownloader:startTask:" + url);
dispatcher.postAction(runnable);
}
@Override
public void onTaskObsolete() {
Log.d("HttpDownloader:onTaskObsolete:" + url);
}
}

View File

@ -1,29 +0,0 @@
package com.droidkit.actors.sample;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by ex3ndr on 20.08.14.
*/
public class IOUtils {
public static byte[] readAll(InputStream in) throws IOException {
BufferedInputStream bufferedInputStream = new BufferedInputStream(in);
ByteArrayOutputStream os = new ByteArrayOutputStream(4096);
byte[] buffer = new byte[4 * 1024];
int len;
int readed = 0;
try {
while ((len = bufferedInputStream.read(buffer)) >= 0) {
Thread.yield();
os.write(buffer, 0, len);
readed += len;
}
} catch (java.io.IOException e) {
}
return os.toByteArray();
}
}

View File

@ -1,15 +0,0 @@
package com.droidkit.actors.sample;
import com.droidkit.actors.ActorRef;
import com.droidkit.actors.ActorSystem;
/**
* Created by ex3ndr on 18.08.14.
*/
public class Log {
private static final ActorRef log = ActorSystem.system().actorOf(LogActor.class, "log");
public static void d(String s) {
log.send(s);
}
}

View File

@ -1,25 +0,0 @@
package com.droidkit.actors.sample;
import android.util.Log;
import com.droidkit.actors.Actor;
/**
* Created by ex3ndr on 14.08.14.
*/
public class LogActor extends Actor {
@Override
public void preStart() {
Log.d("LOGACTOR#" + hashCode(), "preStart");
}
@Override
public void onReceive(Object message) {
Log.d("LOGACTOR#" + hashCode(), message + "");
}
@Override
public void postStop() {
Log.d("LOGACTOR#" + hashCode(), "postStop");
}
}

View File

@ -1,73 +0,0 @@
package com.droidkit.actors.sample;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.droidkit.actors.ActorRef;
import com.droidkit.actors.android.UiActor;
import com.droidkit.actors.android.UiActorDispatcher;
import static com.droidkit.actors.ActorSystem.system;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
system().addDispatcher("ui", new UiActorDispatcher(system()));
// ActorRef log = system().actorOf(LogActor.class, "log");
// ActorRef downloader = system().actorOf(DownloadFile.class, "dow");
// downloader.send("http://flirtyfleurs.com/wp-content/uploads/2012/10/pwg-sample-11_photo.jpg");
// downloader.send("http://flirtyfleurs.com/wp-content/uploads/2012/10/pwg-sample-11_photo.jpg", 600);
// downloader.send("http://flirtyfleurs.com/wp-content/uploads/2012/10/pwg-sample-11_photo.jpg", 3000);
// ActorRef dow2 = system().actorOf(DownloadFile.class, "dow2");
// dow2.send(new String[]{
// "http://flirtyfleurs.com/wp-content/uploads/2012/10/pwg-sample-11_photo.jpg",
// "http://isc.stuorg.iastate.edu/wp-content/uploads/sample.jpg",
// "http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-300mmf_35-56g_ed_vr/img/sample/sample4_l.jpg"});
final TextView view = (TextView) findViewById(R.id.demo);
final UiActor actor = new UiActor() {
@Override
public void onReceive(Object message) {
view.setText(message.toString());
}
};
findViewById(R.id.demoButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (int i = 0; i < 10; i++) {
actor.getActorRef().send("message_" + i, i * 500);
}
}
});
new Thread() {
@Override
public void run() {
ActorRef ref = system().actorOf(CounterActor.class, "counter1");
Log.d("Start");
for (int i = 0; i < 1000000; i++) {
ref.send((Integer) i);
if (i % 1000 == 0) {
Log.d("Progress " + i);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
Log.d("End");
}
}.start();
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,26 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.droidkit.actors.sample.MainActivity">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/demo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo counter"/>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="doDemo"
android:id="@+id/demoButton"/>
</LinearLayout>

View File

@ -1,9 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.droidkit.actors.sample.MainActivity" >
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never" />
</menu>

View File

@ -1,6 +0,0 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>

View File

@ -1,5 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Actors</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
</resources>

View File

@ -1,8 +0,0 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>

View File

@ -1,74 +0,0 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.6
group = 'com.droidkit'
version = libVersion
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
if (project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")) {
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url:
isRelease ?
"https://oss.sonatype.org/service/local/staging/deploy/maven2/":
"https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'DroidKit-Actors'
packaging 'jar'
description 'DroidKit Actors is simple actor model implementation for java and Android'
url 'https://github.com/secretapphd/droidkit-actors'
scm {
url 'scm:git@github.com:secretapphd/droidkit-actors.git'
connection 'scm:git@github.com:secretapphd/droidkit-actors.git'
developerConnection 'scm:git@github.com:secretapphd/droidkit-actors.git'
}
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'ex3ndr'
name 'Stepan Korshakov'
}
}
}
}
}
}
}

View File

@ -1,35 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
// Global version for library project with sample
projectVersion = '0.2'
// External Parameters
isRelease = project.hasProperty("exRelease") ? Boolean.valueOf(exRelease) : false;
buildIndex = Integer.valueOf(project.hasProperty("exBuildIndex") ? exBuildIndex : '20048');
// General version for project
fullVersion = isRelease ? projectVersion + "." + buildIndex : projectVersion + "-SNAPSHOT";
// Notify TeamCity about version
println "##teamcity[buildNumber '$fullVersion']"
// Android application versions
apkVersionCode = Integer.valueOf(buildIndex);
apkVersionName = fullVersion;
//Java/Android library versions
libVersion = fullVersion;

View File

@ -1,18 +0,0 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

View File

@ -1,6 +0,0 @@
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip

View File

@ -1,164 +0,0 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

View File

@ -1,90 +0,0 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1 +0,0 @@
include ':actors', ':actors-android', 'actors-sample'

Binary file not shown.