5 Replies Latest reply on May 4, 2015 9:09 PM by Jon Tara

    Android extensions using common API - what parts work?

    Jon Tara

      It's apparent that Android extensions using common API are pretty broken. I'd appreciate any candid assessment of what parts we can expect to work, and what parts we shouldn't bother with.

       

      I'm closing-in on at least part of it.

       

      The generated code SEEMS to deal with property bag properties, but something is broken, and it just plain doesn't work.

       

      Digging into the Rhodes source code, there aren't any complete, WORKING Android common API modules that use generated code for handling Android property-bag properties. There seem to be several partial/abandoned/unimplemented APIs in the source code, where it appears the author was having the same kind of struggles that I am having.

       

      Where extensions do have a common API with property-bag properties implemented and working, the generated code was not used. The base code has been "collapsed" into the implementation. It is apparent from the source code that setting default property values in the XML file does not work, since there is code in working APIs that sets default values explicitly in code. For iOS, the generated code takes care of this.

       

      For example, from AudioCapture.java:

       

              if(mActualPropertyMap.size()==0)
              {
                  mActualPropertyMap.put("maxDuration", "20000");
                                          
                  //mActualPropertyMap.put("fileName", "AudioCapture");
                  mActualPropertyMap.put("fileName", "");
                  mActualPropertyMap.put("encoder","AAC");
                  mActualPropertyMap.put("source", "mic");
              }
      

       

      So, you can see that default property values are being set explicitly here in code, and default values in the XML will be ignored then.

       

      I think AudioCapture (5.0.30) is the closest thing we have to a working common API with properties that can be used as an example. But it will be painful, because that code doesn't use the generated base classes.

       

      Can a Rhodes developer jump in here and tell us what we can expect to work, and what we shouldn't waste our time on?

       

      Thanks.