Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
27,202

Recently our company posted its first app based on Sybase Unwired Platform and SAP backend developed for SAP Mobile App challenge. In this blog we are sharing the roadblocks we faced during creation of our first app and lessons learned. The first part of blog explaining motivation, overall architecture and technology choise can be found here.

Challenges faced during development

Having such a nice tools for development as SUP's HWC and mGWT we had also several roadblocks on our journey:


  • Calling MBO from JavaScript – event that SUP provides enough of documentation of how to use HWC with standard scenarios, for our special case (as we decided to write UI by our own and not use HWC UI framework built on JQuery) we had to go an extra step to understand how to call MBO from JavaScript. This part was not that much documented and required some amount of time for digging inside internal JavaScript files generated by SUP.

  • Linux/*nix machines support – generated HWC application can run in browser if you run generated index.html page just from folder on your drive as it is described in SUP documentation, but it only assumes windows machines when identifying desktop browser – so we had to modify some scripts to take into account *nix machines as well If you happen to require it as well - here is our tweak - replace content of JavaScript function isWindows() inside API.js with following

/**

  * Returns true iff the workflow application is being run on a Windows platform.

  * @returns True iff the workflow application is being run on a Windows platform.

  */

function isWindows() {   

     if (navigator.platform === "Win32" || (navigator.platform === "Win64") ||

                (navigator.platform === "MacIntel") ||           

               (navigator.platform === "Linux x86_64") { /* this line makes Linux happy */        

                    return true;

     }

    return false;

}


  • Debugging on real device/receiving logs from online device – there is a possibility to write into device console logs from HTML5 application and it is possible to retrieve such logs from device over SUP infrastructure. The procedure how to access these logs is described in SUP documentation, however, these logs are not online and are pulled from device by request with average data transfer duration of about one minute – not a very convenient way to investigate/monitor how your application is working on real device. We had to inject and use our own remote logging service that uses simple AJAX to send every log line back to server in order to have some ability to monitor behavior of application in real time.

Our solution is based on GWT-RPC approach, if it raises interest from community how we did it  I can elaborate more about it in next blog


  • Heavy scripts – initially HWC is supplied with many scripts for supporting a lot of functionality, which takes a lot of time to load and damages a feeling of quick and slim applications by end user – we had to learn what scripts we can take out without breaking HWC framework. In our case we could happily live without following scripts (just remove or comment them out from your index.html generated by SUP):
    • Camera.js
    • Certificate.js (we consider to include it back when we will work with SSO certificates)
    • ExternalResource.js
    • json2.js
    • SUPStorage.js
    • Timezone.js
    • jquery-1.6.4.js
    • jquery.mobile-1.0.js
    • sy.ui.iphone.customButton.js
    • sy.ui.iphone.customFixPositionForm.js
    • sy.ui.iphone.iscroll.js
    • sy.ui.iphone.listview.js
    • sy.ui.iphone.menuBars.js
    • sy.ui.iphone.menus.js
    • sy.ui.iphone.picker.js
    • sy.ui.iphone.signature.js
    • sy.ui.iphone.util.js

  • Modeling of complex relations in MBO – it was hard to find documentation or expertise in community how to properly model MBOs with complex relations like many-to-many or how to define caching of MBO objects or how to control it. Fortunately, SAP is helping partners get more knowledge in this area and we were benefiting from weekly info sessions with SAP experts, community to get this information as well as did a lot of try-and-pray test. At the end we decided not to do any many-to-many relations in MBO and stay with one-to-many relations only.

Lessons learned

Even that I listed so many topics as roadblocks we happily overcome all of them and were able to finish our application on time for SAP Mobile app challenge. We learned a lot, made ourselves even more curious in Sybase Unwired Platform and SAP mobile development topics and learned few lessons that we will bring with us to next SAP mobile project:

  • It is better to have real devices for application testing – emulators works very slow and can be real motivation killers for your team
  • When modeling your MBO and backend access – try to stay within a simple relations (1:n, simple lists)
  • Limit your MBO fields to minimum, if possible – limit your SAP interfaces to minimum as well – it will reduce the mess of data mapping and increase speed of data exchange
  • If you are building your own HTML5 app as we did – plan enough time to test how your application is working inside HWC, remove all parts you will not need (PhoneGap, local storage API, Camera API,…)
  • Pay attention to user logon procedure – you will need some set of HWC functions to make it work proper and secure

Conclusion

After all, we get very positive impression on usage of Sybase Unwired Platform and made our first app there relatively fast, giving that we started with zero knowledge about SUP. For sure we will use SUP for future and some app ideas are already in heads of developers.

Hope you found our feedback informative and helpful and can leverage on our experience, in case of any questions write to me or post in SCN forum - there is enough expertise available to figure an answer for almost any question.

And in case you are interested to see what have we made - here is short demo of our app.


18 Comments
Labels in this area