Skip to content

Commit dfa2265

Browse files
committed
* Fixed problem with OpenME for API 28+
* Changed http access to HTTPS * Provided partial support for https://cKnowledge.io
1 parent cecfc98 commit dfa2265

File tree

11 files changed

+763
-791
lines changed

11 files changed

+763
-791
lines changed

AUTHORS.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=======================================================================
22
N: Grigori Fursin
33
E: Grigori.Fursin@cTuning.org
4-
H: http://fursin.net
5-
O: cTuning foundation / dividiti
4+
H: https://fursin.net
5+
O: cTuning foundation / cKnowledge SAS
66
C: original concept and design
77
W: since 1 November 2014

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ Testimonials and awards
6565
* 2014: HiPEAC technology transfer award: [HiPEAC TT winners](https://www.hipeac.net/research/technology-transfer-awards/2014)
6666
* 2015: ARM and the cTuning foundation use CK to accelerate computer engineering: [HiPEAC Info'45 page 17](https://www.hipeac.net/assets/public/publications/newsletter/hipeacinfo45.pdf), [ARM TechCon'16 presentation and demo](http://schedule.armtechcon.com/session/know-your-workloads-design-more-efficient-systems), [public CK repo](https://github.com/ctuning/ck-wa)
6767

68+
Notes
69+
=====
70+
71+
* API 29 prevents exec() to run downloaded codeletes - we need to find a new solution.
72+
6873
Acknowledgments
6974
===============
7075

71-
CK development is coordinated by the [cTuning
72-
foundation](http://cTuning.org) (non-profit research organization)
73-
and [dividiti](http://dividiti.com).
76+
CK development is coordinated by the [cTuning foundation](https://cTuning.org) (non-profit research organization).
7477
We are also extremely grateful to all
7578
volunteers for their valuable feedback and contributions.
7679

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 27
5-
buildToolsVersion "27.0.3"
4+
compileSdkVersion 28
5+
buildToolsVersion "28.0.3"
66

77
defaultConfig {
88
applicationId "openscience.crowdsource.experiments"
99
minSdkVersion 10
10-
targetSdkVersion 26
11-
versionCode 12
12-
versionName "2.5"
10+
targetSdkVersion 28
11+
versionCode 27
12+
versionName "2.7"
1313
}
1414
buildTypes {
1515
release {

app/release/app-release.apk

2.19 KB
Binary file not shown.

app/release/output.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/src/main/AndroidManifest.xml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="openscience.crowdsource.experiments">
4-
5-
android:versionCode="2"
6-
android:versionName="1.2" >
7-
8-
<application
9-
android:allowBackup="true"
10-
android:icon="@mipmap/ic_launcher"
11-
android:label="@string/app_name"
12-
android:supportsRtl="true"
13-
android:theme="@style/AppTheme">
14-
<activity android:name=".MainActivity">
15-
<intent-filter>
16-
<action android:name="android.intent.action.MAIN" />
17-
18-
<category android:name="android.intent.category.LAUNCHER" />
19-
</intent-filter>
20-
</activity>
21-
</application>
22-
23-
<uses-permission android:name="android.permission.INTERNET" />
24-
25-
</manifest>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="openscience.crowdsource.experiments">
4+
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7+
8+
<uses-permission android:name="android.permission.INTERNET" />
9+
10+
<application
11+
android:allowBackup="true"
12+
android:icon="@mipmap/ic_launcher"
13+
android:label="@string/app_name"
14+
android:supportsRtl="true"
15+
android:theme="@style/AppTheme">
16+
<activity android:name=".MainActivity">
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
25+
</manifest>

app/src/main/java/openscience/crowdsource/experiments/MainActivity.java

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package openscience.crowdsource.experiments;
1818

19+
import android.Manifest;
1920
import android.app.AlertDialog;
2021
import android.content.DialogInterface;
2122
import android.content.Intent;
@@ -86,10 +87,10 @@ public class MainActivity extends AppCompatActivity implements GLSurfaceView.Ren
8687

8788
String url_sdk = "http://github.com/ctuning/ck";
8889
String url_about = "https://github.com/ctuning/ck/wiki/Advanced_usage_crowdsourcing";
89-
String url_stats = "http://cTuning.org/crowd-results";
90-
String url_users = "http://cTuning.org/crowdtuning-timeline";
90+
String url_stats = "https://cTuning.org/crowd-results";
91+
String url_users = "https://cTuning.org/crowdtuning-timeline";
9192

92-
String url_cserver="http://cTuning.org/shared-computing-resources-json/ck.json";
93+
String url_cserver="https://cTuning.org/shared-computing-resources-json/ck.json";
9394
String repo_uoa="upload";
9495

9596
String s_b_start = "Start";
@@ -128,6 +129,12 @@ public class MainActivity extends AppCompatActivity implements GLSurfaceView.Ren
128129
/*************************************************************************/
129130
@Override
130131
protected void onCreate(Bundle savedInstanceState) {
132+
if (Build.VERSION.SDK_INT>Build.VERSION_CODES.LOLLIPOP_MR1) {
133+
String[] perms = { Manifest.permission.READ_EXTERNAL_STORAGE,
134+
Manifest.permission.WRITE_EXTERNAL_STORAGE};
135+
requestPermissions(perms, 200);
136+
}
137+
131138
super.onCreate(savedInstanceState);
132139
setContentView(R.layout.activity_main);
133140

@@ -734,63 +741,22 @@ protected String doInBackground(String... arg0) {
734741
publishProgress("Detecting some of your platform features ...\n");
735742

736743
//Get system info **************************************************
737-
try {
738-
r=openme.read_text_file_and_convert_to_json("/system/build.prop", "=", false, false);
739-
} catch (JSONException e) {
740-
publishProgress("\nError calling OpenME interface (" + e.getMessage() + ") ...\n\n");
741-
return null;
742-
}
744+
String model=Build.MODEL;
745+
String manu=Build.MANUFACTURER;
743746

744-
try {
745-
if ((Long)r.get("return")>0)
746-
publishProgress("\nProblem during OpenME: "+(String) r.get("error")+"\n\n");
747-
} catch (JSONException e) {
748-
publishProgress("\nError calling OpenME interface (" + e.getMessage() + ") ...\n\n");
749-
return null;
750-
}
747+
if (!model.equals("") && !manu.equals(""))
748+
if (model.toLowerCase().startsWith(manu.toLowerCase()))
749+
model=model.substring(manu.length()+1,model.length());
751750

752-
String model="";
753-
String manu="";
751+
if (manu.equals("") && !model.equals("")) manu=model;
754752

755-
JSONObject ra=null;
753+
manu=manu.toUpperCase();
754+
model=model.toUpperCase();
756755

757-
try {
758-
ra=(JSONObject) r.get("dict");
759-
} catch (JSONException e) {
760-
publishProgress("\nError calling OpenME interface (" + e.getMessage() + ") ...\n\n");
761-
return null;
762-
}
763-
764-
if (ra!=null)
765-
{
766-
try {
767-
model=(String) ra.get("ro.product.model");
768-
} catch (JSONException e) {
769-
publishProgress("\nError calling OpenME interface (" + e.getMessage() + ") ...\n\n");
770-
return null;
771-
}
772-
773-
try {
774-
manu=(String) ra.get("ro.product.manufacturer");
775-
} catch (JSONException e) {
776-
publishProgress("\nError calling OpenME interface (" + e.getMessage() + ") ...\n\n");
777-
return null;
778-
}
779-
780-
if (!model.equals("") && !manu.equals(""))
781-
if (model.toLowerCase().startsWith(manu.toLowerCase()))
782-
model=model.substring(manu.length()+1,model.length());
783-
784-
if (manu.equals("") && !model.equals("")) manu=model;
785-
786-
manu=manu.toUpperCase();
787-
model=model.toUpperCase();
788-
789-
pf_system=manu;
790-
if (!model.equals("")) pf_system+=' '+model;
791-
pf_system_model=model;
792-
pf_system_vendor=manu;
793-
}
756+
pf_system=manu;
757+
if (!model.equals("")) pf_system+=' '+model;
758+
pf_system_model=model;
759+
pf_system_vendor=manu;
794760

795761
//Get processor info **************************************************
796762
//It's not yet working properly on heterogeneous CPU, like big/little
@@ -820,6 +786,8 @@ protected String doInBackground(String... arg0) {
820786
}
821787
if (processor_file==null) processor_file="";
822788

789+
JSONObject ra=null;
790+
823791
try {
824792
ra=(JSONObject) r.get("dict");
825793
} catch (JSONException e) {

0 commit comments

Comments
 (0)