forked from commonsguy/cw-advandroid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e50e087
Showing
336 changed files
with
10,410 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.commonsware.android.advservice.client" | ||
android:versionCode="1" | ||
android:versionName="1.0"> | ||
<application android:label="@string/app_name"> | ||
<activity android:name=".BshServiceDemo" | ||
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> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project name="BshServiceDemo" default="help"> | ||
|
||
<!-- The local.properties file is created and updated by the 'android' tool. | ||
It contain the path to the SDK. It should *NOT* be checked in in Version | ||
Control Systems. --> | ||
<property file="local.properties"/> | ||
|
||
<!-- The build.properties file can be created by you and is never touched | ||
by the 'android' tool. This is the place to change some of the default property values | ||
used by the Ant rules. | ||
Here are some properties you may want to change/update: | ||
application-package | ||
the name of your application package as defined in the manifest. Used by the | ||
'uninstall' rule. | ||
source-folder | ||
the name of the source folder. Default is 'src'. | ||
out-folder | ||
the name of the output folder. Default is 'bin'. | ||
Properties related to the SDK location or the project target should be updated | ||
using the 'android' tool with the 'update' action. | ||
This file is an integral part of the build system for your application and | ||
should be checked in in Version Control Systems. | ||
--> | ||
<property file="build.properties"/> | ||
|
||
<!-- The default.properties file is created and updated by the 'android' tool, as well | ||
as ADT. | ||
This file is an integral part of the build system for your application and | ||
should be checked in in Version Control Systems. --> | ||
<property file="default.properties"/> | ||
|
||
<!-- Custom Android task to deal with the project target, and import the proper rules. | ||
This requires ant 1.6.0 or above. --> | ||
<path id="android.antlibs"> | ||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" /> | ||
</path> | ||
|
||
<taskdef name="setup" | ||
classname="com.android.ant.SetupTask" | ||
classpathref="android.antlibs"/> | ||
|
||
<!-- Execute the Android Setup task that will setup some properties specific to the target, | ||
and import the rules files. | ||
To customize the rules, copy/paste them below the task, and disable import by setting | ||
the import attribute to false: | ||
<setup import="false" /> | ||
This will ensure that the properties are setup correctly but that your customized | ||
targets are used. | ||
--> | ||
<setup /> | ||
</project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system use, | ||
# "build.properties", and override values to adapt the script to your | ||
# project structure. | ||
|
||
# Project target. | ||
target=android-3 | ||
sdk-folder=/opt/android-sdk-linux_x86-1.1_r1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
> | ||
<Button | ||
android:id="@+id/eval" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Go!" | ||
/> | ||
<EditText | ||
android:id="@+id/script" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:singleLine="false" | ||
android:gravity="top" | ||
/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">BshServiceDemo</string> | ||
</resources> |
20 changes: 20 additions & 0 deletions
20
AdvServices/RemoteClient/src/com/commonsware/android/advservice/IScript.aidl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*** | ||
Copyright (c) 2009 CommonsWare, LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
not use this file except in compliance with the License. You may obtain | ||
a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package com.commonsware.android.advservice; | ||
|
||
// Declare the interface. | ||
interface IScript { | ||
void executeScript(String script); | ||
} |
81 changes: 81 additions & 0 deletions
81
AdvServices/RemoteClient/src/com/commonsware/android/advservice/client/BshServiceDemo.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/*** | ||
Copyright (c) 2008-2009 CommonsWare, LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
not use this file except in compliance with the License. You may obtain | ||
a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package com.commonsware.android.advservice.client; | ||
|
||
import android.app.Activity; | ||
import android.app.AlertDialog; | ||
import android.content.ComponentName; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.ServiceConnection; | ||
import android.os.Bundle; | ||
import android.os.IBinder; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import com.commonsware.android.advservice.IScript; | ||
|
||
public class BshServiceDemo extends Activity { | ||
private IScript service=null; | ||
private ServiceConnection svcConn=new ServiceConnection() { | ||
public void onServiceConnected(ComponentName className, | ||
IBinder binder) { | ||
service=IScript.Stub.asInterface(binder); | ||
} | ||
|
||
public void onServiceDisconnected(ComponentName className) { | ||
service=null; | ||
} | ||
}; | ||
|
||
@Override | ||
public void onCreate(Bundle icicle) { | ||
super.onCreate(icicle); | ||
setContentView(R.layout.main); | ||
|
||
Button btn=(Button)findViewById(R.id.eval); | ||
final EditText script=(EditText)findViewById(R.id.script); | ||
|
||
btn.setOnClickListener(new View.OnClickListener() { | ||
public void onClick(View view) { | ||
String src=script.getText().toString(); | ||
|
||
try { | ||
service.executeScript(src); | ||
} | ||
catch (android.os.RemoteException e) { | ||
AlertDialog.Builder builder= | ||
new AlertDialog.Builder(BshServiceDemo.this); | ||
|
||
builder | ||
.setTitle("Exception!") | ||
.setMessage(e.toString()) | ||
.setPositiveButton("OK", null) | ||
.show(); | ||
} | ||
} | ||
}); | ||
|
||
bindService(new Intent(IScript.class.getName()), | ||
svcConn, Context.BIND_AUTO_CREATE); | ||
} | ||
|
||
@Override | ||
public void onDestroy() { | ||
super.onDestroy(); | ||
|
||
unbindService(svcConn); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.commonsware.android.advservice.client" | ||
android:versionCode="1" | ||
android:versionName="1.0"> | ||
<application android:label="@string/app_name"> | ||
<activity android:name=".BshServiceDemo" | ||
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> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project name=".BshServiceDemo" default="help"> | ||
|
||
<!-- The local.properties file is created and updated by the 'android' tool. | ||
It contain the path to the SDK. It should *NOT* be checked in in Version | ||
Control Systems. --> | ||
<property file="local.properties"/> | ||
|
||
<!-- The build.properties file can be created by you and is never touched | ||
by the 'android' tool. This is the place to change some of the default property values | ||
used by the Ant rules. | ||
Here are some properties you may want to change/update: | ||
application-package | ||
the name of your application package as defined in the manifest. Used by the | ||
'uninstall' rule. | ||
source-folder | ||
the name of the source folder. Default is 'src'. | ||
out-folder | ||
the name of the output folder. Default is 'bin'. | ||
Properties related to the SDK location or the project target should be updated | ||
using the 'android' tool with the 'update' action. | ||
This file is an integral part of the build system for your application and | ||
should be checked in in Version Control Systems. | ||
--> | ||
<property file="build.properties"/> | ||
|
||
<!-- The default.properties file is created and updated by the 'android' tool, as well | ||
as ADT. | ||
This file is an integral part of the build system for your application and | ||
should be checked in in Version Control Systems. --> | ||
<property file="default.properties"/> | ||
|
||
<!-- Custom Android task to deal with the project target, and import the proper rules. | ||
This requires ant 1.6.0 or above. --> | ||
<path id="android.antlibs"> | ||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" /> | ||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" /> | ||
</path> | ||
|
||
<taskdef name="setup" | ||
classname="com.android.ant.SetupTask" | ||
classpathref="android.antlibs"/> | ||
|
||
<!-- Execute the Android Setup task that will setup some properties specific to the target, | ||
and import the rules files. | ||
To customize the rules, copy/paste them below the task, and disable import by setting | ||
the import attribute to false: | ||
<setup import="false" /> | ||
This will ensure that the properties are setup correctly but that your customized | ||
targets are used. | ||
--> | ||
<setup /> | ||
</project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system use, | ||
# "build.properties", and override values to adapt the script to your | ||
# project structure. | ||
|
||
# Project target. | ||
target=android-3 | ||
sdk-folder=/opt/android-sdk-linux_x86-1.1_r1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
> | ||
<Button | ||
android:id="@+id/eval" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Go!" | ||
/> | ||
<EditText | ||
android:id="@+id/script" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:singleLine="false" | ||
android:gravity="top" | ||
/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">BshServiceDemo</string> | ||
</resources> |
22 changes: 22 additions & 0 deletions
22
AdvServices/RemoteClientEx/src/com/commonsware/android/advservice/IScript.aidl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*** | ||
Copyright (c) 2009 CommonsWare, LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
not use this file except in compliance with the License. You may obtain | ||
a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package com.commonsware.android.advservice; | ||
|
||
import com.commonsware.android.advservice.IScriptResult; | ||
|
||
// Declare the interface. | ||
interface IScript { | ||
void executeScript(String script, IScriptResult cb); | ||
} |
21 changes: 21 additions & 0 deletions
21
AdvServices/RemoteClientEx/src/com/commonsware/android/advservice/IScriptResult.aidl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*** | ||
Copyright (c) 2009 CommonsWare, LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
not use this file except in compliance with the License. You may obtain | ||
a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package com.commonsware.android.advservice; | ||
|
||
// Declare the interface. | ||
interface IScriptResult { | ||
void success(String result); | ||
void failure(String error); | ||
} |
Oops, something went wrong.