rhodes 3.3.1 → 3.3.2.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -2
- data/Manifest.txt +20 -0
- data/Rakefile +2 -1
- data/doc/build.txt +9 -3
- data/doc/configuration.txt +5 -1
- data/doc/device-caps.txt +112 -27
- data/doc/extensions.txt +0 -51
- data/doc/generator.txt +6 -0
- data/doc/rhom.txt +3 -0
- data/doc/simulator.txt +57 -17
- data/doc/ui.txt +24 -27
- data/installer/RHOELEMENTS-EULA.txt +295 -0
- data/installer/Rakefile +75 -49
- data/installer/rhostudio-moto.nsi +534 -0
- data/installer/rhostudio.nsi +13 -4
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/barcode.m +3 -0
- data/lib/framework/rho/rhoapplication.rb +4 -0
- data/lib/framework/rho/rhoevent.rb +2 -3
- data/lib/framework/rho/rhoevent_c.rb +2 -2
- data/lib/framework/rho/rhofsconnector.rb +24 -2
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +3 -3
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +164 -90
- data/platform/android/Rhodes/jni/src/signature.cpp +13 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +76 -34
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +3 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +10 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +0 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Callout.java +6 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +7 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +46 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +29 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +10 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +3 -2
- data/platform/android/build/android.rake +6 -27
- data/platform/android/build/androidcommon.rb +1 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +26 -0
- data/platform/iphone/Classes/AppManager/AppManager.h +1 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +70 -12
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +1 -1
- data/platform/iphone/Classes/Event/Event.m +38 -3
- data/platform/iphone/Classes/Rhodes.m +3 -2
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +1 -1
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/rbuild/iphone.rake +8 -8
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqcorewlanbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libqmldbg_tcp.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulatorMac.zip +0 -0
- data/platform/osx/build/osx.rake +1 -1
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
- data/platform/shared/common/RhoConf.cpp +15 -6
- data/platform/shared/common/RhoConf.h +6 -1
- data/platform/shared/common/RhodesApp.cpp +19 -6
- data/platform/shared/common/RhodesApp.h +4 -2
- data/platform/shared/common/RhodesAppBase.cpp +18 -10
- data/platform/shared/common/RhodesAppBase.h +6 -3
- data/platform/shared/common/map/GeocodingMapEngine.h +2 -2
- data/platform/shared/logging/RhoLogConf.cpp +14 -8
- data/platform/shared/logging/RhoLogConf.h +1 -0
- data/platform/shared/net/HttpServer.cpp +15 -3
- data/platform/shared/net/HttpServer.h +2 -1
- data/platform/shared/qt/curl/curl.pro +1 -1
- data/platform/shared/qt/rhodes/QtMainWindow.h +1 -1
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +2 -2
- data/platform/shared/qt/rhodes/main.cpp +2 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +1 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +11 -1
- data/platform/shared/sync/SyncNotify.cpp +1 -2
- data/platform/shared/sync/SyncNotify.h +2 -2
- data/platform/shared/sync/SyncThread.cpp +27 -12
- data/platform/shared/sync/SyncThread.h +2 -0
- data/platform/shared/unzip/unzip.cpp +3 -2
- data/platform/win32/RhoSimulator/Microsoft.VC80.CRT.manifest +8 -0
- data/platform/win32/RhoSimulator/Microsoft.VC80.OpenMP.manifest +7 -0
- data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
- data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
- data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
- data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
- data/platform/win32/RhoSimulator/libeay32.dll +0 -0
- data/platform/win32/RhoSimulator/msvcm80.dll +0 -0
- data/platform/win32/RhoSimulator/msvcp80.dll +0 -0
- data/platform/win32/RhoSimulator/msvcr80.dll +0 -0
- data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
- data/platform/win32/RhoSimulator/vcomp.dll +0 -0
- data/platform/wm/build/rhodes.nsi +316 -0
- data/platform/wm/build/wm.rake +57 -10
- data/platform/wm/rhodes/Rhodes.cpp +2 -1
- data/platform/wm/rhodes/rhodes.vcproj +2 -0
- data/platform/wm/tools/wmdc_connect.sln +20 -0
- data/platform/wm/tools/wmdc_connect/stdafx.cpp +27 -0
- data/platform/wm/tools/wmdc_connect/stdafx.h +35 -0
- data/platform/wm/tools/wmdc_connect/wmdc_connect.cpp +119 -0
- data/platform/wm/tools/wmdc_connect/wmdc_connect.vcproj +205 -0
- data/platform/wp7/RhoRubyExtGen/RhoAlert.cs +73 -0
- data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
- data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +8 -8
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +47 -6
- data/platform/wp7/RhoRubyLib/RhoRuby.cs +8 -0
- data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +5 -0
- data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +5 -0
- data/platform/wp7/RhoRubyLib/common/RhoParams.cs +2 -1
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +58 -37
- data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +37 -0
- data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +63 -1
- data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +2 -0
- data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +27 -0
- data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +2 -2
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +4 -3
- data/platform/wp7/RhoRubyLib/rubyext/RhoAlert.cs +160 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +44 -12
- data/platform/wp7/RhoRubyLib/sync/ClientRegister.cs +4 -3
- data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +27 -32
- data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +31 -11
- data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +6 -1
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +4 -0
- data/platform/wp7/RhoRubyLib/sync/SyncThread.cs +21 -15
- data/platform/wp7/build/wp.rake +6 -0
- data/rakefile.rb +2 -1
- data/res/build-tools/Coding4Fun.Phone.Controls.dll +0 -0
- data/res/build-tools/wmdc_connect.exe +0 -0
- data/res/generators/templates/spec/app/SpecRunner/index.erb +14 -13
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +10 -1
- data/version +1 -1
- metadata +26 -4
@@ -25,9 +25,11 @@
|
|
25
25
|
*------------------------------------------------------------------------*/
|
26
26
|
|
27
27
|
#include "rhodes/JNIRhodes.h"
|
28
|
+
#include "rhodes/JNIRhoRuby.h"
|
28
29
|
|
29
30
|
#include "rhodes/jni/com_rhomobile_rhodes_signature_Signature.h"
|
30
31
|
|
32
|
+
#include <common/rhoparams.h>
|
31
33
|
#include <common/RhodesApp.h>
|
32
34
|
#include "ruby/ext/rho/rhoruby.h"
|
33
35
|
|
@@ -44,14 +46,15 @@ RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_signature_Signature_callback
|
|
44
46
|
|
45
47
|
RHO_GLOBAL void rho_signature_take(char* callback_url, rho_param* p)
|
46
48
|
{
|
47
|
-
|
49
|
+
|
48
50
|
JNIEnv *env = jnienv();
|
49
51
|
jclass cls = getJNIClass(RHODES_JAVA_CLASS_SIGNATURE);
|
50
52
|
if (!cls) return;
|
51
|
-
jmethodID mid = getJNIClassStaticMethod(env, cls, "takeSignature", "(Ljava/lang/String;Ljava/lang/
|
53
|
+
jmethodID mid = getJNIClassStaticMethod(env, cls, "takeSignature", "(Ljava/lang/String;Ljava/lang/Object;)V");
|
52
54
|
if (!mid) return;
|
53
55
|
jhstring objCallback = rho_cast<jhstring>(callback_url);
|
54
56
|
|
57
|
+
/*
|
55
58
|
char* image_format = 0;
|
56
59
|
if (p)
|
57
60
|
{
|
@@ -64,7 +67,14 @@ RHO_GLOBAL void rho_signature_take(char* callback_url, rho_param* p)
|
|
64
67
|
|
65
68
|
jhstring objFormat = rho_cast<jhstring>(image_format);
|
66
69
|
env->CallStaticVoidMethod(cls, mid, objCallback.get(), objFormat.get());
|
67
|
-
|
70
|
+
*/
|
71
|
+
|
72
|
+
jobject paramsObj = RhoValueConverter(env).createObject(p);
|
73
|
+
env->CallStaticVoidMethod(cls, mid, objCallback.get(), paramsObj);
|
74
|
+
env->DeleteLocalRef(paramsObj);
|
75
|
+
|
76
|
+
|
77
|
+
|
68
78
|
}
|
69
79
|
|
70
80
|
RHO_GLOBAL void rho_signature_visible(bool b, rho_param* p)
|
@@ -44,6 +44,7 @@ import com.rhomobile.rhodes.util.ContextFactory;
|
|
44
44
|
public class RhoCryptImpl
|
45
45
|
{
|
46
46
|
private static final String TAG = "RhoCryptJava";
|
47
|
+
private static final boolean DEBUG = false;
|
47
48
|
|
48
49
|
byte[] m_dbKeyData;
|
49
50
|
String m_strDBPartition;
|
@@ -54,12 +55,28 @@ public class RhoCryptImpl
|
|
54
55
|
private void readKeyFromStorage()
|
55
56
|
{
|
56
57
|
SharedPreferences settings = ContextFactory.getContext().getSharedPreferences( m_strPrefName, Context.MODE_PRIVATE);
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
String strOldKey = settings.getString(m_strDBPartition, "");
|
59
|
+
if (strOldKey != null && strOldKey.length() > 0)
|
60
|
+
{
|
61
|
+
|
62
|
+
m_dbKeyData = Base64.decode(strOldKey);//, Base64.DEFAULT);
|
63
|
+
Logger.I(TAG, "Key is successfully read from Shared Preferences");
|
64
|
+
if(DEBUG) {
|
65
|
+
Logger.I(TAG, "Key: " + dumpKey(m_dbKeyData));
|
66
|
+
Logger.I(TAG, "Encoded key: " + strOldKey);
|
67
|
+
}
|
68
|
+
} else {
|
69
|
+
Logger.I(TAG, "No key is found in Shared Preferences");
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
private static String dumpKey(byte[] key) {
|
74
|
+
StringBuffer buffer = new StringBuffer();
|
75
|
+
for(byte b:key) {
|
76
|
+
buffer.append(String.format("%x ", b));
|
77
|
+
}
|
78
|
+
return buffer.toString();
|
79
|
+
}
|
63
80
|
|
64
81
|
private void generateNewKey()throws Exception
|
65
82
|
{
|
@@ -68,15 +85,28 @@ public class RhoCryptImpl
|
|
68
85
|
kgen.init(m_nKeyLenBit, sr);
|
69
86
|
SecretKey skey = kgen.generateKey();
|
70
87
|
m_dbKeyData = skey.getEncoded();
|
88
|
+
Logger.I(TAG, "New key is generated");
|
89
|
+
if(DEBUG)
|
90
|
+
Logger.I(TAG, "Key: " + dumpKey(m_dbKeyData));
|
71
91
|
}
|
72
92
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
93
|
+
private void writeKeyToStorage()
|
94
|
+
{
|
95
|
+
SharedPreferences settings = ContextFactory.getContext().getSharedPreferences(m_strPrefName, Context.MODE_PRIVATE);
|
96
|
+
SharedPreferences.Editor editor = settings.edit();
|
97
|
+
String strKey = Base64.encodeToString(m_dbKeyData, false);//, Base64.DEFAULT);
|
98
|
+
|
99
|
+
editor.putString(m_strDBPartition, strKey );
|
100
|
+
if (editor.commit()) {
|
101
|
+
Logger.I(TAG, "Key is successfully saved to Shared Preferences");
|
102
|
+
} else {
|
103
|
+
Logger.E(TAG, "Write key to Shared Preferences is failed");
|
104
|
+
}
|
105
|
+
|
106
|
+
if (DEBUG) {
|
107
|
+
Logger.I(TAG, "Key: " + dumpKey(m_dbKeyData));
|
108
|
+
Logger.I(TAG, "Encoded key: " + strKey);
|
109
|
+
}
|
80
110
|
}
|
81
111
|
|
82
112
|
private void initKey(String szPartition)throws Exception
|
@@ -118,35 +148,38 @@ public class RhoCryptImpl
|
|
118
148
|
m_decryptCipher.init(Cipher.DECRYPT_MODE, skeySpec, paramSpec);
|
119
149
|
|
120
150
|
Logger.T(TAG, "RhoCrypt context initialized for partition: " + szPartition);
|
151
|
+
}
|
121
152
|
|
122
|
-
}
|
123
|
-
|
124
|
-
private static void reportFail(String name, Exception e)
|
125
|
-
{
|
126
|
-
Logger.E(TAG, "Call of \"" + name + "\" failed: " + e.getClass().getSimpleName() + ": " + e.getMessage());
|
127
|
-
}
|
128
|
-
|
129
153
|
public boolean db_encrypt( String szPartition, ByteBuffer dataIn, ByteBuffer dataOut )
|
130
154
|
{
|
131
|
-
|
132
|
-
|
133
|
-
|
155
|
+
try
|
156
|
+
{
|
157
|
+
initContext(szPartition);
|
134
158
|
|
135
159
|
dataOut.rewind();
|
136
160
|
|
137
161
|
if (m_encryptCipher == null)
|
138
162
|
throw new NullPointerException("m_encryptCipher == null");
|
139
163
|
|
140
|
-
|
164
|
+
/* *********************************************************
|
165
|
+
* Work around Android 4 bug:
|
166
|
+
* http://code.google.com/p/android/issues/detail?id=24327
|
167
|
+
*/
|
168
|
+
ByteBuffer input = ByteBuffer.allocate(dataIn.capacity());
|
169
|
+
input.put(dataIn);
|
170
|
+
input.rewind();
|
171
|
+
/* ******************************************************* */
|
172
|
+
|
173
|
+
m_encryptCipher.doFinal(input, dataOut);
|
141
174
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
175
|
+
return true;
|
176
|
+
}catch(Exception exc)
|
177
|
+
{
|
178
|
+
Logger.E(TAG, exc);
|
179
|
+
return false;
|
180
|
+
}
|
148
181
|
}
|
149
|
-
|
182
|
+
|
150
183
|
public boolean db_decrypt( String szPartition, ByteBuffer dataIn, ByteBuffer dataOut )
|
151
184
|
{
|
152
185
|
try
|
@@ -158,12 +191,21 @@ public class RhoCryptImpl
|
|
158
191
|
if (m_decryptCipher == null)
|
159
192
|
throw new NullPointerException("m_decryptCipher == null");
|
160
193
|
|
161
|
-
|
194
|
+
/* *********************************************************
|
195
|
+
* Work around Android 4 bug:
|
196
|
+
* http://code.google.com/p/android/issues/detail?id=24327
|
197
|
+
*/
|
198
|
+
ByteBuffer input = ByteBuffer.allocate(dataIn.capacity());
|
199
|
+
input.put(dataIn);
|
200
|
+
input.rewind();
|
201
|
+
/* ******************************************************* */
|
202
|
+
|
203
|
+
m_decryptCipher.doFinal(input, dataOut);
|
162
204
|
|
163
205
|
return true;
|
164
206
|
}catch(Exception exc)
|
165
207
|
{
|
166
|
-
|
208
|
+
Logger.E(TAG, exc);
|
167
209
|
return false;
|
168
210
|
}
|
169
211
|
}
|
@@ -175,7 +217,7 @@ public class RhoCryptImpl
|
|
175
217
|
|
176
218
|
if ( keyData.length != (m_nKeyLenBit/8))
|
177
219
|
{
|
178
|
-
|
220
|
+
Logger.E(TAG, "Incorrect key size : " + keyData.length + "; Should be: " + (int)(m_nKeyLenBit/8));
|
179
221
|
return false;
|
180
222
|
}
|
181
223
|
m_dbKeyData = keyData;
|
@@ -60,7 +60,7 @@ public class RhodesActivity extends BaseActivity {
|
|
60
60
|
|
61
61
|
private static final boolean DEBUG = false;
|
62
62
|
|
63
|
-
public static boolean ENABLE_LOADING_INDICATION =
|
63
|
+
public static boolean ENABLE_LOADING_INDICATION = false;
|
64
64
|
|
65
65
|
public static int MAX_PROGRESS = 10000;
|
66
66
|
|
@@ -137,6 +137,7 @@ public class RhodesActivity extends BaseActivity {
|
|
137
137
|
protected void onCreate(Bundle savedInstanceState) {
|
138
138
|
|
139
139
|
super.onCreate(savedInstanceState);
|
140
|
+
Log.i(TAG, ">>>>>>>>>>>>>>> onCreate()");
|
140
141
|
|
141
142
|
mListeners = new ArrayList<RhodesActivityListener>();
|
142
143
|
|
@@ -154,15 +155,13 @@ public class RhodesActivity extends BaseActivity {
|
|
154
155
|
else {
|
155
156
|
}
|
156
157
|
requestWindowFeature(Window.FEATURE_PROGRESS);
|
157
|
-
|
158
|
+
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, MAX_PROGRESS);
|
158
159
|
|
159
160
|
mHandler = new Handler();
|
160
161
|
|
161
162
|
mSplashScreen = new SplashScreen(this);
|
162
163
|
setMainView(mSplashScreen);
|
163
164
|
|
164
|
-
Log.i(TAG, ">>>>>>>>>>>>>>> onCreate()");
|
165
|
-
|
166
165
|
processStartupListeners();
|
167
166
|
{
|
168
167
|
Iterator<RhodesActivityListener> iterator = mListeners.iterator();
|
@@ -832,7 +832,7 @@ public class RhodesService extends Service {
|
|
832
832
|
return AndroidFunctionalityManager.getAndroidFunctionality().AccessOwnerInfo_getEmail(getContext());
|
833
833
|
}
|
834
834
|
else if (name.equalsIgnoreCase("device_name")) {
|
835
|
-
return Build.DEVICE;
|
835
|
+
return Build.MANUFACTURER + " " + Build.DEVICE;
|
836
836
|
}
|
837
837
|
else if (name.equalsIgnoreCase("is_emulator")) {
|
838
838
|
String strDevice = Build.DEVICE;
|
@@ -91,7 +91,7 @@ public class SplashScreen implements MainView {
|
|
91
91
|
}
|
92
92
|
catch (IOException e) {
|
93
93
|
if (DEBUG)
|
94
|
-
Log.d(TAG, "Can't load " + url
|
94
|
+
Log.d(TAG, "Can't load " + url + ": " + e.getMessage());
|
95
95
|
continue;
|
96
96
|
}
|
97
97
|
finally {
|
@@ -116,7 +116,15 @@ public class SplashScreen implements MainView {
|
|
116
116
|
RhodesApplication.stop();
|
117
117
|
}
|
118
118
|
} else {
|
119
|
-
|
119
|
+
final GoogleWebView googleWebView = new GoogleWebView(context);
|
120
|
+
view = googleWebView;
|
121
|
+
RhodesApplication.runWhen(RhodesApplication.AppState.AppStarted, new RhodesApplication.StateHandler(true) {
|
122
|
+
@Override
|
123
|
+
public void run()
|
124
|
+
{
|
125
|
+
googleWebView.applyWebSettings();
|
126
|
+
}
|
127
|
+
});
|
120
128
|
}
|
121
129
|
|
122
130
|
switch (type) {
|
@@ -37,10 +37,7 @@ import android.util.DisplayMetrics;
|
|
37
37
|
import com.google.android.maps.GeoPoint;
|
38
38
|
import com.google.android.maps.ItemizedOverlay;
|
39
39
|
import com.google.android.maps.OverlayItem;
|
40
|
-
import com.rhomobile.rhodes.RhodesService;
|
41
|
-
import com.rhomobile.rhodes.WebView;
|
42
40
|
import com.rhomobile.rhodes.file.RhoFileApi;
|
43
|
-
import com.rhomobile.rhodes.util.Utils;
|
44
41
|
|
45
42
|
public class AnnotationsOverlay extends ItemizedOverlay<OverlayItem> {
|
46
43
|
|
@@ -75,7 +75,11 @@ public class Callout {
|
|
75
75
|
mTitle = title;
|
76
76
|
mDetails = details;
|
77
77
|
mUrl = url;
|
78
|
-
|
78
|
+
|
79
|
+
if (mDetails == null) {
|
80
|
+
mDetails = "";
|
81
|
+
}
|
82
|
+
|
79
83
|
if (mUrl != null) {
|
80
84
|
if (mUrl.length() < 2) {
|
81
85
|
mUrl = null;
|
@@ -84,8 +88,6 @@ public class Callout {
|
|
84
88
|
|
85
89
|
Paint paint = new Paint();
|
86
90
|
paint.setAntiAlias(true);
|
87
|
-
|
88
|
-
|
89
91
|
|
90
92
|
int title_width = 0;
|
91
93
|
int title_height = 0;
|
@@ -99,12 +101,11 @@ public class Callout {
|
|
99
101
|
title_height = rcLine.bottom - rcLine.top;
|
100
102
|
int max_text_width = title_width;
|
101
103
|
|
102
|
-
|
103
104
|
int details_width = 0;
|
104
105
|
int details_height = 0;
|
105
106
|
int details_max_line_height = 0;
|
106
107
|
// calc Details size (W,H)
|
107
|
-
String [] lines =
|
108
|
+
String [] lines = mDetails.split("\n");
|
108
109
|
int i;
|
109
110
|
paint.setColor(DETAILS_COLOR);
|
110
111
|
paint.setTextSize(DETAILS_FONT_SIZE);
|
@@ -57,7 +57,6 @@ import com.rhomobile.rhodes.RhoConf;
|
|
57
57
|
import com.rhomobile.rhodes.RhodesActivity;
|
58
58
|
import com.rhomobile.rhodes.RhodesService;
|
59
59
|
import com.rhomobile.rhodes.util.PerformOnUiThread;
|
60
|
-
import com.rhomobile.rhodes.util.Utils;
|
61
60
|
|
62
61
|
public class GoogleMapView extends MapActivity {
|
63
62
|
|
@@ -55,6 +55,7 @@ public class ImageCapture extends BaseActivity implements OnClickListener
|
|
55
55
|
|
56
56
|
private String callbackUrl;
|
57
57
|
private String imageFormat;
|
58
|
+
|
58
59
|
private SimpleDateFormat timeStampFormat = new SimpleDateFormat("yyyyMMddHHmmssSS");
|
59
60
|
|
60
61
|
private SignatureView surfaceView;
|
@@ -74,7 +75,7 @@ public class ImageCapture extends BaseActivity implements OnClickListener
|
|
74
75
|
|
75
76
|
Bundle extras = getIntent().getExtras();
|
76
77
|
callbackUrl = extras.getString(com.rhomobile.rhodes.signature.Signature.INTENT_EXTRA_PREFIX + "callback");
|
77
|
-
imageFormat = extras.getString(com.rhomobile.rhodes.signature.Signature.INTENT_EXTRA_PREFIX + "
|
78
|
+
imageFormat = extras.getString(com.rhomobile.rhodes.signature.Signature.INTENT_EXTRA_PREFIX + "imageFormat");
|
78
79
|
|
79
80
|
surfaceView = (SignatureView) findViewById(AndroidR.id.signature_view);
|
80
81
|
surfaceHolder = surfaceView.getHolder();
|
@@ -86,6 +87,11 @@ public class ImageCapture extends BaseActivity implements OnClickListener
|
|
86
87
|
clearButton.setOnClickListener(this);
|
87
88
|
okButton = (ImageButton)findViewById(AndroidR.id.sig_okButton);
|
88
89
|
okButton.setOnClickListener(this);
|
90
|
+
|
91
|
+
int penColor = extras.getInt(com.rhomobile.rhodes.signature.Signature.INTENT_EXTRA_PREFIX + "penColor");
|
92
|
+
float penWidth = extras.getFloat(com.rhomobile.rhodes.signature.Signature.INTENT_EXTRA_PREFIX + "penWidth");
|
93
|
+
int bgColor = extras.getInt(com.rhomobile.rhodes.signature.Signature.INTENT_EXTRA_PREFIX + "bgColor");
|
94
|
+
surfaceView.setupView(penColor, penWidth, bgColor);
|
89
95
|
}
|
90
96
|
|
91
97
|
@Override
|
@@ -27,6 +27,8 @@
|
|
27
27
|
package com.rhomobile.rhodes.signature;
|
28
28
|
|
29
29
|
import java.io.File;
|
30
|
+
import java.util.Map;
|
31
|
+
import java.util.Vector;
|
30
32
|
|
31
33
|
import android.content.Intent;
|
32
34
|
|
@@ -55,12 +57,18 @@ public class Signature {
|
|
55
57
|
private static class Picture implements Runnable {
|
56
58
|
private String url;
|
57
59
|
private Class<?> klass;
|
58
|
-
private String
|
60
|
+
private String imageFormat;
|
61
|
+
private int penColor;
|
62
|
+
private float penWidth;
|
63
|
+
private int bgColor;
|
59
64
|
|
60
|
-
public Picture(String u, Class<?> c, String
|
65
|
+
public Picture(String u, Class<?> c, String _imageFormat, int _penColor, float _penWidth, int _bgColor) {
|
61
66
|
url = u;
|
62
67
|
klass = c;
|
63
|
-
|
68
|
+
imageFormat = _imageFormat;
|
69
|
+
penColor = _penColor;
|
70
|
+
penWidth = _penWidth;
|
71
|
+
bgColor = _bgColor;
|
64
72
|
}
|
65
73
|
|
66
74
|
public void run() {
|
@@ -68,14 +76,46 @@ public class Signature {
|
|
68
76
|
RhodesActivity ra = RhodesActivity.getInstance();
|
69
77
|
Intent intent = new Intent(ra, klass);
|
70
78
|
intent.putExtra(INTENT_EXTRA_PREFIX + "callback", url);
|
71
|
-
intent.putExtra(INTENT_EXTRA_PREFIX + "
|
79
|
+
intent.putExtra(INTENT_EXTRA_PREFIX + "imageFormat", imageFormat);
|
80
|
+
intent.putExtra(INTENT_EXTRA_PREFIX + "penColor", penColor);
|
81
|
+
intent.putExtra(INTENT_EXTRA_PREFIX + "penWidth", penWidth);
|
82
|
+
intent.putExtra(INTENT_EXTRA_PREFIX + "bgColor", bgColor);
|
72
83
|
ra.startActivity(intent);
|
73
84
|
}
|
74
85
|
};
|
75
86
|
|
76
|
-
public static void takeSignature(String url,
|
87
|
+
public static void takeSignature(String url, Object params) {
|
77
88
|
try {
|
78
|
-
|
89
|
+
String imageFormat = "png";
|
90
|
+
int penColor = 0xFF66009A;
|
91
|
+
float penWidth = 2;
|
92
|
+
int bgColor = 0xFFFFFFFF;
|
93
|
+
|
94
|
+
if (params instanceof Map<?,?>) {
|
95
|
+
Map<Object,Object> settings = (Map<Object,Object>)params;
|
96
|
+
|
97
|
+
Object imgFrmtObj = settings.get("imageFormat");
|
98
|
+
if ((imgFrmtObj != null) && (imgFrmtObj instanceof String)) {
|
99
|
+
imageFormat = new String(((String)imgFrmtObj));
|
100
|
+
}
|
101
|
+
|
102
|
+
Object penColorObj = settings.get("penColor");
|
103
|
+
if ((penColorObj != null) && (penColorObj instanceof String)) {
|
104
|
+
penColor = Integer.parseInt((String)penColorObj) | 0xFF000000;
|
105
|
+
}
|
106
|
+
|
107
|
+
Object penWidthObj = settings.get("penWidth");
|
108
|
+
if ((penWidthObj != null) && (penWidthObj instanceof String)) {
|
109
|
+
penWidth = Float.parseFloat((String)penWidthObj);
|
110
|
+
}
|
111
|
+
|
112
|
+
Object bgColorObj = settings.get("bgColor");
|
113
|
+
if ((bgColorObj != null) && (bgColorObj instanceof String)) {
|
114
|
+
bgColor = Integer.parseInt((String)bgColorObj) | 0xFF000000;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
Runnable runnable = new Picture(url, ImageCapture.class, imageFormat, penColor, penWidth, bgColor);
|
79
119
|
PerformOnUiThread.exec(runnable, false);
|
80
120
|
}
|
81
121
|
catch (Exception e) {
|