Working with Device Information in the Oracle Mobile Application Framework

With the proliferation of new device models, form factors and operating systems, you may be thinking about the challenges to make your application work handle all of these different device properties information as there may be features that rely on specific characteristics or capabilities.

As an example, how frustrating it would be for the user trying to use a mapping feature if the device doesn't support geolocation? Or, just getting the device screen height and width to make sure the content fits nicely and also dynamically present different things on the smaller / larger real state you have available. As a developer, it's your responsibility to make sure everything works and looks good on all devices (even though this is a hard task).

The Oracle Mobile Application Framework (MAF) utilizes Apache Cordova to provide access to device properties, SMS, Email, Contacts, Camera, Pictures/Photo Library, Geolocation, Accelerometer, Network, etc. that can either be accessed from Java, JavaScript and Expression Languages in order to support these requirements on your mobile application.

Additionally, the most common functionality (sendEmail, getPicture, createContact, sendSMS, etc) is exposed as a Data Control and can be simply dragged-and-dropped onto an AMX page reducing the need for coding calls to the API and constructing the necessary screens.

The MAF documentation covers all in details but here is a list of what's currently supported by the framework (through the embedded Apache Cordova API):
  • device.name
  • device.platform
  • device.version
  • device.os
  • device.model
  • device.phonegap
  • hardware.hasCamera
  • hardware.hasContacts
  • hardware.hasTouchScreen
  • hardware.hasGeolocation
  • hardware.hasAccelerometer
  • hardware.hasCompass
  • hardware.hasFileAccess
  • hardware.hasLocalStorage
  • hardware.hasMediaPlayer
  • hardware.hasMediaRecorder
  • hardware.networkStatus
  • hardware.screen.width
  • hardware.screen.height
  • hardware.screen.availableWidth
  • hardware.screen.availableHeight
  • hardware.screen.dpi
  • hardware.screen.diagonalSize
  • hardware.screen.scaleFactor

Most of the property names are self-explanatory and I won't go into the details of each one of them but there is a demo available for you that shows how to get started and use some of the information that the framework provides. Screenshots on both platforms are available below so you can take a peek what it looks like:


iOS Simulator
Android Emulator

The demo itself uses EL (expression languages) to get the values and then present them in different ways on the AMX page including outputText, buttons, etc and also change the availability of the component based on the feature capability.

In summary, integrating the device features into a Oracle MAF application is easy and flexible, the declarative drag and drop support suits most of the use cases and you can get deeper control programatically.

The source code is available here: https://github.com/mjabali/DeviceFeatures

Have fun!



Comments

  1. Excellent post!!! Java is most popular and efficient programming language available in the market today. It helps developers to create stunning desktop/web applications loaded with stunning functionalities. JAVA Training in Chennai | JAVA Training Institutes in Chennai

    ReplyDelete
  2. Hi, This is Jamuna from Chennai. I have read your blog and I got some knowledgeable information through this blog. Really useful blog. Keep update your blog.

    Regards...
    Java Training in Chennai

    ReplyDelete
  3. Hi
    Beautiful article..I really enjoyed for reading and get some knowledgeable info from this blog..Keep posting and sharing with us.Thanks a lot.

    ReplyDelete
  4. The information you have given here are most worthy for me. I have implemented in my training program as well, thanks for sharing.

    Hadoop Training Chennai
    Hadoop Training in Chennai

    ReplyDelete
  5. I have read your blog, it was good to read & I am getting some useful info's through your blog keep sharing... Informatica is an ETL tools helps to transform your old business leads into new vision. Learn Informatica training in chennai from corporate professionals with very good experience in informatica tool.
    Regards,
    Best Informatica Training In Chennai|Informatica training center in Chennai

    ReplyDelete
  6. Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
    Regards,
    SAP training in chennai|SAP course in chennai|SAP Training in Chennai|sap course in Chennai

    ReplyDelete

  7. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Regards,
    ccna course in Chennai|ccna training in Chennai|ccna courses in Chennai

    ReplyDelete
  8. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    cloud computing training in chennai | cloud computing courses in chennai

    ReplyDelete
  9. I really got more information from your site. Keep on sharing.
    SAS Training in Chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

Calling Web Services with Apache Camel

How to Declare Variables in MS-SQL Server Management Studio

Using HTTP-based endpoints with Apache Camel