rhodes 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/CHANGELOG +6 -0
  2. data/Manifest.txt +3 -1
  3. data/bin/rhodes-setup +1 -32
  4. data/lib/framework/erb.rb +3 -3
  5. data/lib/framework/rhodes.rb +2 -2
  6. data/lib/framework/version.rb +2 -2
  7. data/lib/rhodes.rb +2 -2
  8. data/platform/android/Rhodes/AndroidManifest.xml +3 -2
  9. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_Rhodes.h +2 -2
  10. data/platform/android/Rhodes/jni/src/rhodes.cpp +7 -5
  11. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +2 -0
  12. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +15 -6
  13. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +5 -2
  14. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +8 -2
  15. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java +11 -0
  16. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +310 -0
  17. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +275 -0
  18. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +125 -322
  19. data/platform/android/build/RhodesSRC_build.files +23 -21
  20. data/platform/android/build/android.rake +40 -17
  21. data/platform/iphone/Info.plist +1 -1
  22. data/platform/iphone/rbuild/iphone.rake +58 -33
  23. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +1 -1
  24. data/platform/shared/common/RhoPort.h +18 -3
  25. data/platform/shared/common/RhodesApp.cpp +76 -54
  26. data/platform/shared/common/StringConverter.h +3 -2
  27. data/platform/shared/common/stat.h +29 -4
  28. data/platform/shared/db/DBAdapter.cpp +2 -1
  29. data/platform/shared/db/DBAdapter.h +1 -1
  30. data/platform/shared/json/RJSONTokener.c +1 -1
  31. data/platform/shared/json/json_object.c +2 -2
  32. data/platform/shared/json/json_tokener.c +1 -1
  33. data/rhodes.gemspec +1 -1
  34. data/spec/phone_spec/app/Spec/contacts_spec.rb +10 -3
  35. data/spec/phone_spec/app/Spec/controller.rb +3 -3
  36. data/spec/phone_spec/app/Spec/mapview_spec.rb +3 -1
  37. data/spec/phone_spec/build.yml +2 -1
  38. metadata +6 -4
  39. data/rhobuild.yml +0 -39
@@ -104,6 +104,7 @@ CONVERT_TYPE_W( short, L"%hd" );
104
104
  CONVERT_TYPE_W( bool, L"%d" );
105
105
  CONVERT_TYPE_W( float, L"%f" );
106
106
  CONVERT_TYPE_W( double, L"%lf" );
107
+
107
108
  #endif
108
109
  CONVERT_TYPE_A( unsigned int, "%u" );
109
110
  CONVERT_TYPE_A( int, "%d" );
@@ -118,8 +119,8 @@ CONVERT_TYPE_A( short, "%hd" );
118
119
  CONVERT_TYPE_A( float, "%f" );
119
120
  CONVERT_TYPE_A( double, "%lf" );
120
121
 
121
- CONVERT_TYPE_A( uint64, "%llu" );
122
- CONVERT_TYPE_A( int64, "%lli" );
122
+ CONVERT_TYPE_A( uint64, FMTU64 );
123
+ CONVERT_TYPE_A( int64, FMTI64 );
123
124
 
124
125
  // Special case for bool
125
126
  template<> inline void convertFromStringA<bool>( const char* szValue, bool& value )
@@ -1,6 +1,31 @@
1
- /*
2
- #if defined(__APPLE__) && !(defined(__DARWIN_ONLY_64_BIT_INO_T) && ___DARWIN_ONLY_64_BIT_INO_T)
3
- #define __DARWIN_ONLY_64_BIT_INO_T 1
1
+ #if defined(__APPLE__) && !defined(__arm__) && !defined(__IPHONE_4_0)
2
+ /* Simulator 3.2 or less */
3
+ #define RHO_IPHONE_SIMULATOR_3
4
4
  #endif
5
- */
5
+
6
+ #ifdef RHO_IPHONE_SIMULATOR_3
7
+ #ifdef stat
8
+ #undef stat
9
+ #endif
10
+ #ifdef lstat
11
+ #undef lstat
12
+ #endif
13
+ #ifdef fstat
14
+ #undef fstat
15
+ #endif
16
+ #endif
17
+
6
18
  #include <sys/stat.h>
19
+
20
+ #ifdef RHO_IPHONE_SIMULATOR_3
21
+ /*
22
+ * map stat functions and structure to theirs 64-bit analogues to be binary
23
+ * compatible with iPhone 4 x86/x86_64 application - in iPhone 4 SDK stat
24
+ * become 64-bit only so enabling such mapping we could run applications built
25
+ * with 3.x SDK on iPhone 4 simulator
26
+ * This is not required for iPhone devices - there stat was always 64-bit.
27
+ */
28
+ #define stat stat64
29
+ #define lstat lstat64
30
+ #define fstat fstat64
31
+ #endif
@@ -100,6 +100,7 @@ boolean CDBAdapter::checkDbErrorEx(int rc, rho::db::CDBResult& res)
100
100
 
101
101
  void CDBAdapter::open (String strDbPath, String strVer, boolean bTemp)
102
102
  {
103
+ LOG(INFO) + "Open DB: " + strDbPath;
103
104
  if ( strcasecmp(strDbPath.c_str(),m_strDbPath.c_str() ) == 0 )
104
105
  return;
105
106
  close();
@@ -901,4 +902,4 @@ void CRubyMutex::Unlock()
901
902
  }
902
903
 
903
904
  }
904
- }
905
+ }
@@ -55,7 +55,7 @@ public:
55
55
  DEFINE_LOGCLASS;
56
56
 
57
57
  CDBAdapter(const char* szDBPartition, boolean bNoRubyLock) : m_dbHandle(0), m_strDbPath(""), m_strDbPartition(szDBPartition),
58
- m_bUIWaitDB(false), m_nTransactionCounter(0), m_mxRuby(bNoRubyLock) {}
58
+ m_mxRuby(bNoRubyLock), m_bUIWaitDB(false), m_nTransactionCounter(0) {}
59
59
  ~CDBAdapter(void){}
60
60
 
61
61
  void open (String strDbPath, String strVer, boolean bTemp);
@@ -443,7 +443,7 @@ struct json_object* rjson_tokener_parse_ex(struct json_tokener *tok,
443
443
  } else {
444
444
  int64 numi = 0;
445
445
  double numd = 0;
446
- if(!tok->is_double && sscanf(tok->pb->buf, "%lli", &numi) == 1) {
446
+ if(!tok->is_double && sscanf(tok->pb->buf, FMTI64/*"%lli"*/, &numi) == 1) {
447
447
  current = rjson_object_new_int(numi);
448
448
  } else if(tok->is_double && sscanf(tok->pb->buf, "%lf", &numd) == 1) {
449
449
  current = rjson_object_new_double(numd);
@@ -324,7 +324,7 @@ boolean json_object_get_boolean(struct json_object *this)
324
324
  static int json_object_int_to_json_string(struct json_object* this,
325
325
  struct printbuf *pb)
326
326
  {
327
- return sprintbuf(pb, "%lli", this->o.c_int);
327
+ return sprintbuf(pb, FMTI64/*"%lli"*/, this->o.c_int);
328
328
  }
329
329
 
330
330
  struct json_object* json_object_new_int(int64 i)
@@ -349,7 +349,7 @@ int64 json_object_get_int(struct json_object *this)
349
349
  case json_type_boolean:
350
350
  return this->o.c_boolean;
351
351
  case json_type_string:
352
- if(sscanf(this->o.c_string, "%lli", &cint) == 1) return cint;
352
+ if(sscanf(this->o.c_string, FMTI64/*"%lli"*/, &cint) == 1) return cint;
353
353
  default:
354
354
  return 0;
355
355
  }
@@ -403,7 +403,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
403
403
  } else {
404
404
  int64 numi = 0;
405
405
  double numd = 0;
406
- if(!tok->is_double && sscanf(tok->pb->buf, "%lli", &numi) == 1) {
406
+ if(!tok->is_double && sscanf(tok->pb->buf, FMTI64/*"%lli"*/, &numi) == 1) {
407
407
  current = json_object_new_int(numi);
408
408
  } else if(tok->is_double && sscanf(tok->pb->buf, "%lf", &numd) == 1) {
409
409
  current = json_object_new_double(numd);
@@ -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 = '2.0.0'
6
+ s.version = '2.0.2'
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Rhomobile"]
@@ -25,6 +25,7 @@ class ContactsTest
25
25
  mobile_number = '+1222333444'
26
26
 
27
27
  contacts = Rho::RhoContact.find(:all)
28
+ puts "contacts: #{contacts.inspect.to_s}"
28
29
  Test_not_equal( contacts, nil )
29
30
 
30
31
  contact = {}
@@ -34,6 +35,7 @@ class ContactsTest
34
35
  Rho::RhoContact.create!(contact)
35
36
 
36
37
  newcontacts = Rho::RhoContact.find(:all)
38
+ puts "newcontacts: #{newcontacts.inspect.to_s}"
37
39
  Test_not_equal( newcontacts, nil )
38
40
 
39
41
  diff = newcontacts.diff(contacts)
@@ -45,24 +47,28 @@ class ContactsTest
45
47
  Test_equal( c['mobile_number'], mobile_number )
46
48
 
47
49
  @id = c['id']
50
+ puts "id: #{@id}"
48
51
  end
49
52
 
50
53
  def update_test
54
+ puts "id: #{@id}"
51
55
  Rho::RhoContact.update_attributes 'id' => @id, 'first_name' => "RANDOM", 'last_name' => "NEWBIE"
52
56
 
53
57
  contact = Rho::RhoContact.find(@id)
58
+ puts "contacts: #{contact.inspect.to_s}"
54
59
  Test_not_equal( contact, nil )
55
60
 
56
61
  unless System.get_property('platform') == 'Blackberry'
57
- #https://www.pivotaltracker.com/story/show/3983643
58
- Test_equal( contact['first_name'], 'RANDOM' )
59
- Test_equal( contact['last_name'], 'NEWBIE' )
62
+ #https://www.pivotaltracker.com/story/show/3983643
63
+ Test_equal( contact['first_name'], 'RANDOM' )
64
+ Test_equal( contact['last_name'], 'NEWBIE' )
60
65
  end
61
66
 
62
67
  end
63
68
 
64
69
  def remove_test
65
70
  contacts = Rho::RhoContact.find(:all)
71
+ puts "contacts: #{contacts.inspect.to_s}"
66
72
  Test_not_equal( contacts, nil )
67
73
  Test_equal( contacts.size >= 1, true )
68
74
 
@@ -71,6 +77,7 @@ class ContactsTest
71
77
  Rho::RhoContact.destroy(@id)
72
78
 
73
79
  contacts = Rho::RhoContact.find(:all)
80
+ puts "new contacts: #{contacts.inspect.to_s}"
74
81
  Test_not_equal( contacts, nil )
75
82
 
76
83
  Test_equal( size - contacts.size, 1 )
@@ -2,11 +2,11 @@ require 'rho/rhocontroller'
2
2
  require 'Spec/spec_runner'
3
3
 
4
4
  def Test_equal(p1,p2)
5
- raise "Expected '#{p1}' equal to '#{p2}'" if p1 != p2
5
+ raise "Expected '#{p1.inspect.to_s}' equal to '#{p2.inspect.to_s}'" if p1 != p2
6
6
  end
7
7
 
8
8
  def Test_not_equal(p1,p2)
9
- raise "Expected '#{p1}' not equal to '#{p2}'" if p1 == p2
9
+ raise "Expected '#{p1.inspect.to_s}' not equal to '#{p2.inspect.to_s}'" if p1 == p2
10
10
  end
11
11
 
12
12
  class SpecController < Rho::RhoController
@@ -66,4 +66,4 @@ class SpecController < Rho::RhoController
66
66
  end
67
67
  end
68
68
 
69
- end
69
+ end
@@ -9,7 +9,9 @@ class MapViewTest
9
9
  Test_equal( state, nil )
10
10
 
11
11
  MapView.create :settings => {:map_type => 'roadmap', :region => [37, -122, 10, 10]}
12
- sleep 2
12
+ w = 2
13
+ w = 5 if System::get_property('platform') == 'ANDROID'
14
+ sleep w
13
15
 
14
16
  state = MapView.state
15
17
  Test_not_equal( state, nil )
@@ -13,7 +13,8 @@ iphone:
13
13
  codesignidentity: ""
14
14
  configuration: Debug
15
15
  android:
16
- version: 1.6
16
+ version: 2.0
17
+ mapping: enabled
17
18
  capabilities:
18
19
  - network_state
19
20
  - pim
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhodes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.0
9
+ - 2
10
+ version: 2.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rhomobile
@@ -455,6 +455,9 @@ files:
455
455
  - platform/android/Rhodes/src/com/rhomobile/rhodes/NetworkConnectivityListener.java
456
456
  - platform/android/Rhodes/src/com/rhomobile/rhodes/NetworkStateTracker.java
457
457
  - platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java
458
+ - platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java
459
+ - platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java
460
+ - platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java
458
461
  - platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactField.java
459
462
  - platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java
460
463
  - platform/android/Rhodes/src/com/rhomobile/rhodes/RhoConf.java
@@ -3663,7 +3666,6 @@ files:
3663
3666
  - res/generators/templates/spec/app/spec_runner.rb
3664
3667
  - res/generators/templates/spec/app/SpecRunner/controller.rb
3665
3668
  - res/generators/templates/spec/app/SpecRunner/index.erb
3666
- - rhobuild.yml
3667
3669
  - rhobuild.yml.example
3668
3670
  - rhodes.gemspec
3669
3671
  - spec/framework_spec/app/Account/account.rb
@@ -1,39 +0,0 @@
1
- ---
2
- excludedirs:
3
- bb:
4
- - public/js/iui
5
- - public/js/jquery*
6
- - public/jqtouch*
7
- - public/js/prototype*
8
- - public/css/iphone*
9
- - public/iwebkit
10
- - public/themes
11
- - "**/*.db"
12
- - "**/.*.swo"
13
- - "**/.*.swn"
14
- - "**/jquery*.js"
15
- - "**/.DS_Store"
16
- env:
17
- app: /Users/lars/Dev/code/rhomobile/store
18
- paths:
19
- android-ndk: /Users/lars/Dev/android-ndk-r4
20
- android: /Users/lars/Dev/android-sdk-mac_86
21
- java: /Library/Java/Home/bin
22
- 4.6:
23
- jde:
24
- sim: 9000
25
- mds:
26
- 4.2:
27
- jde:
28
- sim: 8100
29
- mds:
30
- cabwiz:
31
- android:
32
- build:
33
- bbsignpwd: somepasswordhere
34
- bb:
35
- symbianpath: platform/symbian
36
- bbpath: platform/bb
37
- androidpath: platform/android
38
- wmpath: platform/wm
39
- iphonepath: platform/iphone