What is an Application.OnError and How We Handle It?


What is Application.OnError?

Negative paths in app development can be easily missed by the app developer and in most of the cases developer feels it is a burden to carry on. With using the generic error handling in Smartface App Studio enables the developer to handle those negative paths only at once, define a generic approach for it. It is possible to customize it according to the network object (which means which case it is), what is the response code, user friendly messages received from server, etc…

This generic onError event captures only other unhandled error cases, such as server responds an http error code and this is not handled with the server error of the network object or Javascript executes an invalid statement which is not in a try catch statement, all could be handled and managed.

This is same for Javascript cases; this interpreted programming language is easy to make mistakes. On design-time the most effective way is making a syntax check, but programmers know that it is not enough. Run-time errors can occur any time, and it is not easily realized by the developer and after the error developer tries to figure out why the code is not working.

And What We Did?

Smartface App Studio now provides a new feature which will speed up the mobile app development. From now on it is easier to handle errors in the application: Run-time Javascript Errors, Network Errors, and SQL Errors. They all could be managed from a single location.

This onError event is flexible, it adapts to case about what is the error; developer does not need to change his or her development habits. If it is a network error, the parameter is network error object, if it is a Javascript error (exception) the parameter is the native Javascript Error object which caught on try-catch statements.

BTW: Here is our Tips & Tricks document and some code examples about Application.OnError statement.


Why Smartface App Studio?

We asked ourselves why people like to use Smartface App Studio? Developers or project managers, would like to develop your exciting projects with us. Starting from this question, we will outline your benefits of developing with Smartface App Studio.


fastIt will be FAST and EFFICIENT

  • WYSIWYG design editor: “What You See Is What You Get” design editor allows you to get %99 of what you’ve designed on your device runtime. In addition, rule-based structure of IDE supports same experience for multiple devices.
  • JavaScript code editor: You have %100 JavaScript supported code editor for you to explore your JavaScript skills.
  • On Device Emulator: Plug your device (iOS and Android) via usb and see what you’re developing right away.


It will be EASY and READY to USE

  • Memory Management: You really don’t need to think for the problems related to memory management. We’re always handling such challenges for you.
  • Network Components Wizards (SOAP, JSON…): Smartface App Studio’s ‘Web Service’ and ‘Web Client’ wizards are ready for you to integrate your network services into your app.
  • Ready to Use Libraries (Animation, Security, Capturing…): We have already integrated and shared many custom libraries for you to take advantage of third party solutions. We love the community.


TESTING is not a nightmare

  • Single Code Based: Different test scenarios for multiple channels and operating systems are over! Since you will be responsible for only single-code, you just need logic tests.
  • On Device Debugging: Plug your device (iOS and Android) via usb and test & debug your app in real time.


COMPATIBILITY is what we breath

  • Device Specific Features may cause some bugs or even a specific versions to get affected.  When using Smartface app studio, this won’t be a problem for you because Smartface App Studio detects all these device specific issues and provides you bug free solutions with new setup.


  • We believe new OS updates are not the cause of fragmentation problems. When Smartface App Studio is used, you just need to open your project with the latest set up in the event that Apple and Google releases new iOS versions.


Enjoy platform’s FLEXIBILITY

  • Plug-In: You may write your own plug-ins and add components to integrate them into Smartface App Studio to extend your project.
  • The Power of JavaScript: Use JavaScript with all aspects of WebKit playground.


Your app is SECURE

  • Customized JavaScript (JS) Engine inside: We do not use common JS Engine. We developed our own proprietary JS Engine by integrating numerous advanced security libraries.
  •  Certified by Symantec: Security of Smartface App Studio has been tested and certified by Symantec.


Project Management

  • Yes, it is NATIVE and Cross-Platform: Smartface App Studio provides you native outputs for iOS and Android, which will  decrease your costs associated with development, testing and project management by nearly %50 percent.
  • Required Basic Knowledge: Mobile development is complex itself. Managing multiple platforms and products are even more complex.
  • Keep Moving: Smartface is ready for newer technologies such as wearables. Are you ready?


We believe the speed and efficiency of your mobile project development  will certainly increase with all these benefits and features described above.


Can’t Dos

  • No game, no utilities: We do not recommend developing games and utilities with Smartface App Studio.
  • Some apps need enhanced know-how: Like all frameworks, Smartface App Studio needs qualified developers to show their skills on complex apps.
  • Not many apps developed by Smartface App Studio: Smartface App Studio is being developed for the past 3 years and we just introduced it to the community in January 2014.
  • Mac and Linux support: We’re working on it.
  • Dependency: Because of the framework structure Smartface App studio is built on, you won’t be able to edit the source code of your project. There are some other tools in the market who claims they can do this; however, they only allow C++ coding.

Smartface Get Everything Done About Memory Management for You

We’ve done everything what you expect from Smartface. Analyze common problems for memory management on mobile devices and packaged you all in one solutions. You don’t need to take care of platform based memory optimizations while developing with Smartface App Studio.


Memory management is the hardest part of mobile development. Mobile devices, from cheaper ones to the most expensive ones, have limited amount of dynamic memory compared to our personal computers. While you’re developing your application; you need to take this constraint into consideration by freeing the resources you don’t need and minimize them not to destroy user experience. If you fail to manage your application’s memory resources which are provided by the operating system, that means you are going to face with random crashes, UI freezes and finally a bunch of angry users. Also your application’s poor handling will affect other idle background applications; they will get closed by system to provide you with more memory (usually the memory you don’t even need).

Poor memory management shows itself in various ways:

1-    Allocating more memory space than application actually needs,

2-    Not releasing the memory area retained by application,

3-    Releasing a memory area more than once (usually as a result of multi-thread operations),

4-    While using automatic memory solutions (ARC or GC), losing the tracks of your objects.


Before iOS version 4.0, developers had to manage all the objects which were created themselves. Or they had to use –autorelease syntax to let system manage them. After announcement of ARC (Automatic Reference Counting), most part of the job is done by ARC structure. But this time again, developers have to manage object pointers to help ARC, which is responsible for releasing unused objects. Also ARC introduced another complexity about memory management: strong-weak pointers. With strong-weak pointer distinction, now you have to avoid retain cycles. Avoiding retain-cycles is a little more complicated than manually managing everything when you haven’t made a good design in the beginning.



In contrast to a Garbage Collected environment, ARC immediately frees a memory area when there’s no “strong” reference left to it. Besides, GC scans the heap on unknown intervals to free unused memory, and takes the responsibility of the most critical aspect of mobile development. As an iOS developer myself, I would feel very uncomfortable about this if GC is used on iOS. This inconvenience already makes ARC the best solution to memory management for mobile devices.


All these pitfalls of mobile development are not a problem for Smartface developers. With Smartface framework, we eliminate memory management troubles ourselves. For example; if you are a native developer using mobile device’s camera to take a picture, you will have to be very careful with raw image data. You will try to find a way to release it as soon as possible since it’s very much for your responsive application. But with Smartface, using Image helper functions, all of these will be our responsibility. Images are saved, scaled or even rotated with a single line of code without any memory dubiousness.


Pages, UI objects, network data is mostly created and open place on run-time without noticing the SAS developer. Even if the developer makes junior mistakes such as putting lots of massive sized images in a RepeatBox object, we will try hard to catch native memory-warnings of iOS and -at least- prevent crashing. Also with our object data models in C++ core interface, which stands between the JavaScript engine and native Objective-C code; you will be able to reach the properties of UI objects that aren’t actually exist in memory as a respectable UI object.


But as a JavaScript developer, you will still have some responsibilities about memory management. Since JavaScript has Garbage Collection, you should better keep an eye on the global objects that you have created. I still think JavaScript objects are no big deal compared to million pixels of image data or UI layers drawn on screen, and their effect on your application’s responsiveness will be too little. But if you’re a mobile developer, you should better use every bit of that address space effectively.


Smartface App Studio is ready for Gear apps!

Smartface App Studio is incredible! Samsung currently not being shared SDK for Gear, but you can develop your apps for Gear with using Smartface App Studio.




How to Develop?

Everything is almost the same as Android development with App Studio. Just take care few points.

1) Just choose Galaxy Gear screen resolution from Project Details.

2) Delete the Android location services permission from AndroidManifest.xml of your project.

3) Get .apk package from App Studio and send it to Samsung Gear via adb.

That’s all!

You can checked detailed information here.

Native vs. Hybrid


We think end-users and some of developers confused about native, hybrid and web apps (mostly known HTML5 apps). That’s why we’re trying to explain you these environments development and usage differences and some commons.

Let’s start with a few words about what types of apps are they:

Native apps; are specific to a given mobile platform using the development tools and language that the respective platform supports. Xcode IDE and Objective-C language for iOS, Eclipse IDE and Java language for Android. Visual Studio IDE and C# language for Windows Phone. Native apps looks like as users get used to, fluid and performs well.

Hybrid apps; make it possible to embed HTML5 apps inside a thin native container, combining the best (and worst) elements of native and HTML5 apps.

HTML5 apps; use standard web technologies such as HTML5, JavaScript and CSS. This write-once-run-anywhere approach to mobile development creates cross-platform mobile applications that work on multiple devices. While developers can create sophisticated apps with HTML5 and JavaScript alone.










Hybrid Apps


Quicker development, especially if you’re a longtime web developer.
One language can be used on every available platform. This, of course, requires a Phonegap wrapper. You don’t need to learn Objective-C, Java, or C# to do any development. You need only to understand the basics of the Phonegap implementation. You will need to give attention to above-mentioned languages a bit but you don’t need to know all of them exactly. Also Phonegap offers some native capabilities for iOS and Android native components.

Lower budget costs and a big community support.

A hybrid app offers many of the advantages of both approaches access to the most common device APIs, and broad device coverage while not requiring the specialized skills, bigger budgets and longer time to market that are more typical of fully native apps.


It takes lots of time to learn platform, literally and metaphorically.

Mobile phones (even today’s tablets) are not fast enough to smoothly run a hybrid apps, needs more power. Android platform is very hard for developers for many reasons. Page transitions don’t work smoothly not to mention lacking CSS/CSS3 implementation. If you think native Android 2.X and 4.X have differences. iOS fares better but still has a lacking CSS3 implementation and much better page transitions.

You will spend much more time fixing the app then building it. Creating an app for each and every platform is a pain in the neck. Browsers on different platforms do not uniformly support all the latest HTML features and APIs, which can make developing and testing a challenge. If you don’t have a good designer, don’t even try to build an app; looks are everything.

If you don’t know what are you doing there’s a good chance your app will not get permission for Apple app store. Even Google Play Store will ban your app if they discover a 3rd party Phonegap PayPal plugin.

Security will be a big issue for web apps. Mostly opens for hack attacks and this will be a big trouble when you need secure apps.

Different type of engine customizations for web apps will result on segmentation problems. Some customer needs match with your development engine but some not and that’s why it’s hard to configure needs and solutions.

Native vs Hybrid


Native Apps


A native mobile app can produce the best user experience — fast and fluid, can give you the best access to device features, and can be discovered in the app stores.

Without a doubt, native apps have full access to the underlying mobile platform. Native apps are usually very fast and polished, making them great for high performance apps or games. This is more than enough.


Bigger budget. You will need at least a person/s with Java and Objective-C knowledge. Java may be comes easier than Objective-C but Objective-C is a world of its own. It has a rather uncommon syntax.

It might take you a longer period of time to develop all of them and time is money. This depends on the complexity of the apps.





App Features
Graphics API Native Complicated Complicated
Look, Feel, Sense, UX Native xml xml Interpreter Web or native make up
Performance Fastest Fast enough Kindly slow
Device Sensors Yes Depends on tech Depends on tech
Offline Storage Device storage Limited device storage and shared web storage Limited device storage and shared web storage
Connectivity Online and offline usage Online and offline usage Mostly online usage
Development Environment Objective-C, Java, C#, JS (Smartface) HTML5/JS/CSS HTML5/JS/CSS
Security Most secure Depends on tech. Mostly secure Opens for attacks
Device Specific Features Yes Depends on tech Depends on tech

Just in 24 Hours…


Well. This was probably the best hackathon (or named kodathon) in Turkey at 2013.

Kodathon was organized by kodcu.com, @seanxyu, @altugaltintas, @fkadev. First of all, thanks all of them for this wonderful event. Kodathon was at Koç University Nisantasi Campus which is near the American Hospital. There were approx. 15 group and it means 15 different ideas and apps in the competition.








We joined this kodathon as Smartface team, @OytunAtLinux, @faruktoptas, @gokhanmandaci and @gemcienes. Idea should based on Istanbul’s problems cause of main topic. Istanbul is a huge city and like all other big cities, it has lots of problems. That’s why we thought not only to focus on one specific problem. We tried to collect all the problems of Istanbul under a one social network, which we called it “kentbenim” (In English “CityofMine”).

We developed “kentbenim” by Smartface App Studio and gets it ready for iOS and Android just in a 15 hours of hard work. It’s totally ready for publish after 15 hours of work for both platforms. Also there was a server side of this application and it’s developed with PHP.







This is a social network, which you’re taking a picture of any Istanbul problem and tag it under sorted problem names. App will recognize your location and will post it through network. Users choices, which are tagged pictures of problems will shown in main page and people can vote these problems. Most voted problems will be up and thus, Istanbul’s problems sorted by citizens. This will show the fact of what people wants and what authorities doing. “CityofMine” is your app. Istanbul is your city. Problems are forcing you while trying to survive in this city life.

What we’ve done? How we start? Is it possible to create a social network app with Smartface only in a 15 hours?

Like all mobile apps, first we defined our rules of design and draw mock-up. We designed principals of app with using Adobe Photoshop. We found %70 percent of icons from web and %30 percent of icons was created by us. We used Adobe Illustrator for creating and modifying icons. It takes 6 hours. That’s probably because of my skills on Photoshop and Illustrator J

You can check our mock-up evolution here:

mockup_anasayfa   mockup2mainPage









Then we implent our design to the app with using Smartface App Studio’s extremely easy drag&drop UI components. App Studio’s WhatYouSeeIsWhatYouGet design editor helps us to create what we draw on paper to get same thing from app. It was like a copying Photoshop pages to an app. It takes approx. 5-6 hours of work. Here are first screenshots of app while developing:







After that, we’ve started to write connections between app and server side. Also this was so easy with App Studio’s web client wizard tools and it takes 2-3 hours of coding in a script editor of App Studio.


I think after midnight most of us falling into sleep…








We woke up at 9 o’clock and prepared for jury. Jury look into every project and selected first 6 out of 15. “kentbenim” is also chosen by jury. And lastly, chosen 6 presented their projects to everyone and all participators selected first 3. Smartface crew’s project becomes 3rd at Kodathon 2013. 2nd was some kind of robotics projects and 1st was mobile payment and alert project for city buses of Istanbul.








Check it out our website: www.kentbenim.net

This is all about kodathon2013 and everybody enjoyed too much. It was fun!

See you next time…