rhodes 3.0.1.beta.6 → 3.0.1.beta.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -3,6 +3,8 @@
3
3
  * Android: fix push issues
4
4
  * Support Android 3.1
5
5
  * Support Windows Phone 7.1(Mango)
6
+ * Blackberry 6: fix geolocation
7
+ * Android 2.3.4: fix web browser issue with redirect
6
8
 
7
9
  ## 3.0
8
10
  * RhoSimulator: simulator for fast Rhodes application development, support debugging using Rhodes Eclipse plug-in.(Windows only)
data/Rakefile CHANGED
@@ -107,7 +107,7 @@ def make_application_build_capabilities_header_file
107
107
 
108
108
  capabilities = $app_config["capabilities"]
109
109
 
110
- if capabilities != nil
110
+ if capabilities != nil && capabilities.is_a?(Array)
111
111
  capabilities.each do |cap|
112
112
  caps << cap
113
113
  end
data/doc/build.txt CHANGED
@@ -241,7 +241,7 @@ In case if you are planning to work with native geo mapping (MapView interface),
241
241
  android:
242
242
  mapping: yes
243
243
 
244
- If you are using Eclipse (Optional) please follow [these instructions](http://source.android.com/using-eclipse) on how to increase Java memory space to use Android.
244
+ If you are using Eclipse (Optional) please follow [these instructions](http://source.android.com/source/using-eclipse.html) on how to increase Java memory space to use Android.
245
245
 
246
246
 
247
247
  Please check you applications and change the way how you include css files into html pages.
@@ -305,6 +305,7 @@ Next, in your controller action that displays the object(s), add the object noti
305
305
 
306
306
  # refresh the current page
307
307
  WebView.refresh
308
+ # or call System.execute_js to call javascript function which will update list
308
309
  end
309
310
  end
310
311
 
@@ -36,7 +36,8 @@ module Rho
36
36
  parts = line.chomp.split('|')
37
37
 
38
38
  row = {}
39
- columns.each_with_index do |col,idx|
39
+ columns.each_with_index do |col,idx|
40
+ col.strip!
40
41
  if col == 'source_name'
41
42
  src_name = parts[idx]
42
43
  src_name = source_map[src_name] if source_map
@@ -491,10 +491,12 @@ public class RhodesActivity extends BaseActivity {
491
491
  }
492
492
 
493
493
  String urlStart = uri.getPath();
494
- if (urlStart.compareTo("") != 0)
495
- {
496
- Logger.D(TAG, "PROCESS URL START: " + urlStart);
497
- RhoConf.setString("start_path", Uri.decode(urlStart));
494
+ if (urlStart != null) {
495
+ if ("".compareTo(urlStart) != 0)
496
+ {
497
+ Logger.D(TAG, "PROCESS URL START: " + urlStart);
498
+ RhoConf.setString("start_path", Uri.decode(urlStart));
499
+ }
498
500
  }
499
501
 
500
502
  ENABLE_LOADING_INDICATION = !RhoConf.getBool("disable_loading_indication");
@@ -1239,7 +1239,7 @@ public class RhodesService extends Service {
1239
1239
  }
1240
1240
 
1241
1241
  String syncSources = extras.getString("do_sync");
1242
- if (syncSources != null) {
1242
+ if ((syncSources != null) && (syncSources.length() > 0)) {
1243
1243
  Logger.D(TAG, "PUSH: Sync:");
1244
1244
  boolean syncAll = false;
1245
1245
  for (String source : syncSources.split(",")) {
@@ -347,7 +347,7 @@ def apk_build(sdk, apk_name, res_name, dex_name, debug)
347
347
  params = [apk_name, "-u", "-z", res_name, "-f", dex_name]
348
348
  end
349
349
 
350
- Jake.run("apkbuilder" + $bat_ext, params)
350
+ Jake.run File.join(".", "apkbuilder" + $bat_ext), params
351
351
 
352
352
  unless $?.success?
353
353
  Dir.chdir prev_dir
@@ -855,14 +855,6 @@ public class RhoConnection implements IHttpConnection {
855
855
  if ( responseData != null )
856
856
  contentLength = Integer.parseInt(resHeaders.getPropertyIgnoreCase("Content-Length"));
857
857
 
858
- try {
859
- IRhoRubyHelper helper = RhoClassFactory.createRhoRubyHelper();
860
- helper.wakeUpGeoLocation();
861
- }catch(Exception exc)
862
- {
863
- LOG.ERROR("getGeoLocationText failed", exc);
864
- }
865
-
866
858
  }
867
859
  }
868
860
 
@@ -1362,6 +1362,15 @@ final public class RhodesApplication extends RhodesApplicationPlatform implement
1362
1362
  m_bDisableInput = true;
1363
1363
  m_oBrowserAdapter.processConnection(connection, e);
1364
1364
  m_bDisableInput = false;
1365
+
1366
+ try {
1367
+ IRhoRubyHelper helper = RhoClassFactory.createRhoRubyHelper();
1368
+ helper.wakeUpGeoLocation();
1369
+ }catch(Exception exc)
1370
+ {
1371
+ LOG.ERROR("wakeUpGeoLocation failed", exc);
1372
+ }
1373
+
1365
1374
  }
1366
1375
 
1367
1376
  public static class PrimaryResourceFetchThread {//extends Thread {
@@ -1170,7 +1170,7 @@ void rho_http_redirect( void* httpContext, const char* szUrl)
1170
1170
  headers.push_back(HttpHeader("Content-Type", "text/plain"));
1171
1171
 
1172
1172
  CHttpServer *serv = (CHttpServer *)httpContext;
1173
- serv->send_response(serv->create_response("301 Moved Permanently", headers));
1173
+ serv->send_response(serv->create_response("301 Moved Permanently", headers), true);
1174
1174
  }
1175
1175
 
1176
1176
  void rho_http_senderror(void* httpContext, int nError, const char* szMsg)
@@ -569,6 +569,17 @@ bool CHttpServer::send_response_impl(String const &data, bool continuation)
569
569
  return true;
570
570
  }
571
571
 
572
+ bool CHttpServer::send_response(String const &response, bool redirect)
573
+ {
574
+ #ifdef OS_ANDROID
575
+ if (redirect) {
576
+ CAutoPtr<IRhoThreadImpl> ptrThread = rho_get_RhoClassFactory()->createThreadImpl();
577
+ ptrThread->sleep(20);
578
+ }
579
+ #endif
580
+ return send_response_impl(response, false);
581
+ }
582
+
572
583
  String CHttpServer::create_response(String const &reason)
573
584
  {
574
585
  return create_response(reason, "");
@@ -1049,16 +1060,16 @@ bool CHttpServer::decide(String const &method, String const &arg_uri, String con
1049
1060
 
1050
1061
  String uri = arg_uri;
1051
1062
 
1052
- #ifdef OS_ANDROID
1053
- //Work around malformed Android WebView URLs
1054
- if (!String_startsWith(uri, "/app") &&
1055
- !String_startsWith(uri, "/public") &&
1056
- !String_startsWith(uri, "/data"))
1057
- {
1058
- RAWTRACE1("Malformed URL: '%s', adding '/app' prefix.", uri.c_str());
1059
- uri = CFilePath::join("/app", uri);
1060
- }
1061
- #endif
1063
+ //#ifdef OS_ANDROID
1064
+ // //Work around malformed Android WebView URLs
1065
+ // if (!String_startsWith(uri, "/app") &&
1066
+ // !String_startsWith(uri, "/public") &&
1067
+ // !String_startsWith(uri, "/data"))
1068
+ // {
1069
+ // RAWTRACE1("Malformed URL: '%s', adding '/app' prefix.", uri.c_str());
1070
+ // uri = CFilePath::join("/app", uri);
1071
+ // }
1072
+ //#endif
1062
1073
 
1063
1074
  String fullPath = CFilePath::join(m_root, uri);
1064
1075
 
@@ -1072,7 +1083,10 @@ bool CHttpServer::decide(String const &method, String const &arg_uri, String con
1072
1083
  String reply(getStringFromValue(data), getStringLenFromValue(data));
1073
1084
  rho_ruby_releaseValue(data);
1074
1085
 
1075
- if (!send_response(reply))
1086
+ bool isRedirect = String_startsWith(reply, "HTTP/1.1 301") ||
1087
+ String_startsWith(reply, "HTTP/1.1 302");
1088
+
1089
+ if (!send_response(reply, isRedirect))
1076
1090
  return false;
1077
1091
 
1078
1092
  if (method == "GET")
@@ -1084,7 +1098,7 @@ bool CHttpServer::decide(String const &method, String const &arg_uri, String con
1084
1098
  return true;
1085
1099
  }
1086
1100
 
1087
- #ifndef OS_ANDROID
1101
+ //#ifndef OS_ANDROID
1088
1102
  if (isdir(fullPath)) {
1089
1103
  RAWTRACE1("Uri %s is directory, redirecting to index", uri.c_str());
1090
1104
  String q = query.empty() ? "" : "?" + query;
@@ -1092,17 +1106,17 @@ bool CHttpServer::decide(String const &method, String const &arg_uri, String con
1092
1106
  HeaderList headers;
1093
1107
  headers.push_back(Header("Location", CFilePath::join( uri, "index"RHO_ERB_EXT) + q));
1094
1108
 
1095
- send_response(create_response("301 Moved Permanently", headers));
1109
+ send_response(create_response("301 Moved Permanently", headers), true);
1096
1110
  return false;
1097
1111
  }
1098
- #else
1099
- //Work around this Android redirect bug:
1100
- //http://code.google.com/p/android/issues/detail?can=2&q=11583&id=11583
1101
- if (isdir(fullPath)) {
1102
- RAWTRACE1("Uri %s is directory, override with index", uri.c_str());
1103
- return decide(method, CFilePath::join( uri, "index"RHO_ERB_EXT), query, headers, body);
1104
- }
1105
- #endif
1112
+ //#else
1113
+ // //Work around this Android redirect bug:
1114
+ // //http://code.google.com/p/android/issues/detail?can=2&q=11583&id=11583
1115
+ // if (isdir(fullPath)) {
1116
+ // RAWTRACE1("Uri %s is directory, override with index", uri.c_str());
1117
+ // return decide(method, CFilePath::join( uri, "index"RHO_ERB_EXT), query, headers, body);
1118
+ // }
1119
+ //#endif
1106
1120
  if (isindex(uri)) {
1107
1121
  if (!isfile(fullPath)) {
1108
1122
  RAWLOG_ERROR1("The file %s was not found", fullPath.c_str());
@@ -77,7 +77,7 @@ public:
77
77
  bool run();
78
78
  void stop();
79
79
 
80
- bool send_response(String const &response) {return send_response_impl(response, false);}
80
+ bool send_response(String const &response, bool redirect = false);
81
81
  bool send_response_body(String const &data) {return send_response_impl(data, true);}
82
82
 
83
83
  String create_response(String const &reason);
@@ -124,3 +124,4 @@ private:
124
124
  } // namespace rho
125
125
 
126
126
  #endif // RHO_HTTP_SERVER_F5FFD21AD3EE463E850C5E2C789397BD
127
+
data/rakefile.rb CHANGED
@@ -107,7 +107,7 @@ def make_application_build_capabilities_header_file
107
107
 
108
108
  capabilities = $app_config["capabilities"]
109
109
 
110
- if capabilities != nil
110
+ if capabilities != nil && capabilities.is_a?(Array)
111
111
  capabilities.each do |cap|
112
112
  caps << cap
113
113
  end
data/rhodes.gemspec CHANGED
@@ -3,7 +3,7 @@ require "lib/rhodes.rb"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{rhodes}
6
- s.version = "3.0.1.beta.6"
6
+ s.version = "3.0.1.beta.7"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Rhomobile"]
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhodes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196423
4
+ hash: 62196421
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 1
10
10
  - beta
11
- - 6
12
- version: 3.0.1.beta.6
11
+ - 7
12
+ version: 3.0.1.beta.7
13
13
  platform: ruby
14
14
  authors:
15
15
  - Rhomobile
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-31 00:00:00 -07:00
20
+ date: 2011-06-01 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency