Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop GameDev
docevent archive 2022 event date/location session presenter s gdc2022 may 21-25, 2022san francisco, usa unfolding your gaming potential with galaxy gamedev gdc vault michael barnes, head of game ecosystem at samsung research uk gdc2022 may 21-25, 2022san francisco, usa game performance optimization with causal models gdc vault hesham dar, senior data scientist at samsung research uk gdc2022 may 21-25, 2022san francisco, usa what if your phone's avatar is in the game or metaverse? gdc vault jinho lim, principal engineerjeoungju kim, principal engineersanglae kim, staff engineer gdc2022 may 21-25, 2022san francisco, usa new gpu, the ultimate reality! gdc vault gary keen, engineer, samsung research uk 2020 event date/location session presenter s unite seoul 2020 201203online how to optimize sustainable gaming performance in mobile devices using adaptive performance video munseong kang unity korea webinar 2020 200730online how to maintain stable gaming performance, adaptive performance video inae kim, jihyun oh unity unite now 2020 200723online build aaa games with adaptive performance video benjamin mitchell 2019 event date/location session presenter s unity webinar seoul 2019 191212seoul, korea adaptive performance video_korean junsik kong, jihyun oh unity reboot develop red 2019 191030banff, canada mobilizing call of duty bringing a blockbuster title to android video benjamin mitchell sdc 2019 191030san jose,usa a deep look inside games gamesdk and unity adaptive performance video junsik kong, david berger unity sdc 2019 191030san jose,usa vulkanized mobile game optimization techniques pdf igor nazarov,yao wei sdc 2019 191030san jose,usa galaxy gamedev bringing maximun boost to mobile gamesⅱ video jungwoo kim, seunghwan lee, richard huddy unite copenhagen 2019 190923københavn,denmark bringing call of duty to mobile video/slide jungwoo kim, anton syniavskyi casual connect london 190528london,uk next level mobile graphics video munseoung kang,oleksii vasylenko unite seoul 2019 190521seoul, korea technique of mobile game optimization-vulkan and unity adaptive performance video junsik kong, seunghwan lee, david berger unity unite seoul 2019 190521seoul, korea keynote pdf jungwoo kim unite shanghai 2019 190512shanghai,china gamedev partner practices pdf yao wei unite shanghai 2019 190512shanghai,china keynote pdf joonyong park google i/o 2019 190507mountainview,usa making high fidelity android games possible with vulkan video jungwoo kim, francesco carucci google , tom olson arm unreal summit seoul 2019 190503seoul, korea vulkan mobile optimization white book video/pdf-korean joonyong park, dohyun kim reboot develop blue 2019 190419dubrovnik,croatia some seriously explicit lessons in vulkan video alon or-bach, karlo jez croteam unreal fest europe 2019 190411prague, czech republic vulkan! powering aaa experiences on android video oleksii vasylenko,michael parkin-white gdc2019 190318-190322sanfrancisco,usa bringing 'fortnite' to mobile with vulkan and opengles presented by khronos pdf/video kostiantyn drabeniuk, jack porter epic games gdc2019 190318-190322sanfrancisco,usa a quick look inside your game gpuwatch & gamesdk presented by samsung video hyokeun lee, junsik kong, david berger unity gdc2019 190318-190322sanfrancisco,usa galaxy gamedev bringing maximum boost to mobile games presented by samsung video jungwoo kim, dohyun kim, sangmin lee gdc2019 190318-190322sanfrancisco,usa all-in-one guide to vulkan on mobile presented by samsung and arm michael parkin-white gdc2019 190318-190322sanfrancisco,usa making use of new vulkan features presented by khronos video lewis gordon, dr matthäus chajdas amd , tiemo jung gaijin entertainment 2018 event date/location session presenter s sdc2018 181107-181108sanfrancisco,usa going into the new era galaxy gamedev -update,secrets and leaks video jungwoo kim, richard huddy sdc2018 181107-181108sanfrancisco,usa a quick look inside your games gpuwatch tutorial + gameengine talk video hyo-keun lee, niklas smedberg unity sdc2018 181107-181108sanfrancisco,usa fortnite behind the story road to android and vulkan collaboration with galaxy gamedev video sangmin lee, jack porter epic games siggraph 2018 180812-180816vancouver, canada moving mobile graphics mobile graphics 101 pdf andrew garrard vulkanised!2018 180522cambridge,uk the low-level mysteries of pipeline barriers pdf/video frederic garnier, andrew garrard android game developer summit 2018 180507mountainview,usa vulkan game optimization video jungwoo kim, ito kosei luminous productions , yoshimasa enji summertimestudio unite seoul 2018 180502-180504seoul,south korea keynote pdf taeyong kim vulkan developer day in montreal 2018 180430montreal,canada overview and vulkan 1 1 recap video alon or-bach gdc2018 180319-180323sanfrancisco,usa vulkan on android gotchas and best practices presented by the khronos group video frederic garnier, inae kim, arseny kapoulkine roblox gdc2018 180319-180323sanfrancisco,usa getting explicit how hard is vulkan really? hosted by the khronos group video alon or-bach, dustin land id software , dr matthäus chajdas amd , hai nguyen google , arseny kapoulkine roblox gdc2018 180319-180323sanfrancisco,usa perfdoc optimize early with vulkan validation layer tools presented by arm link jungwoo kim, hans-kristian arntzen arm 2017 event date/location session presenter s gcon g-star 2017 171117busan,south korea future mobile game ecosystem and high fidelity android gaming pdf meeso kim, jungwoo kim sdc 2017 171018-171019sanfrancisco,usa developing high-fidelity android games collaboration best practices video eunsil cho,ethan choi hound13 ,ito kosei square enix ,ebato takahito square enix sdc 2017 171018-171019sanfrancisco,usa vulkan game optimization deep-dive case study video daemyung jang, jungwoo kim sdc 2017 171018-171019sanfrancisco,usa level up your game! new insights and tools for game developers video jungwoo kim, jongheun yoo game republic mobile games special 171018sheffield,uk samsung game ecosystem pdf david pither html5ct forum 171013seoul,south korea introducing vulkan with practices pdf jungwoo kim unreal fest east 2017 171008yokohama,japan developing high performance games for android pdf jungwoo kim, hak matsuda google khronos-vulkanised!2017 170525cambridge,uk bringing vainglory to vulkan pdf fred garnier khronos-vulkanised!2017 170525cambridge,uk panel discussion worst practices! lessons learnt from game devs pioneering with vulkan video alon or-bach, tobias hector img , fred garnier, dean sekulic croteam ,hans-kristian arntzen arm , tom olson arm google i/o 2017 170519mountain view,usa developing high performance games for android video jungwoo kim, bill bilodeau google , donghyun kim netmarble android game developer summit 2017 170516mountainview,usa game optimization pdf jungwoo kim, jonas gustavsson unite seoul 2017 170516-170517seoul,south korea keynote pdf joonyong park ndc 2017 170425-170427pangyo,south korea developing vulkan game with unity pdf seunghwan lee, inae kim, daemyung jang gdc2017 170227sanfrancisco,usa vulkan game development in mobile pdf soowan park gdc2017 170227sanfrancisco,usa refocusing on vr innovation can standards simplify cross-platform virtual reality development? pdf/video alon or-bach gdc2017 170227sanfrancisco,usa mobile the future of vr pdf/video alon or-bach casual connect berlin 170208berlin,germany optimizing high-end games for premium mobile devices video jonas gustavsson, joe davis hci korea 2017 170208-170210jeongseon,south korea future of vr with vulkan pdf daemyung jang 2016 event date/location session presenter s gcon g-star 2016 161118busan,south korea vulkan and the future of mobile gaming pdf meeso kim, jungwoo kim khronos-vulkan devu 161021seoul,south korea vulkan tutorial pdf hyokeun lee, minwook kim khronos-vulkan devu 161021seoul,south korea vulkan case study video soowan park, joonyong park cedec 2016 160824-160826yokohama,japan the vulkan™ new generation graphics api – an introduction and overview pdf jungwoo kim e3 2016 160614-160616los angeles,usa samsung e3 press conference pdf jungwoo kim khronos-moving to vulkan 160525cambridge,uk swapchains unchained video alon or-bach sdc2016 160427sanfrancisco,usa introducing the galaxy gamedev program video taeyong kim, rob dyer, ray tran, carl callewaert sdc2016 160427sanfrancisco,usa introducing vulkan for galaxy s7 video jungwoo kim, valentyn kulikovskiy sdc2016 160427sanfrancisco,usa unreal engine developing console-level games with vulkan video jungwoo kim, niklas smedberg epic games
Learn Code Lab
codelabdevelop a smartthings find-compatible device objective learn how to create your own smartthings find-compatible device using the smartthings find partnership program device sdk learn how to measure the radio frequency rf performance of a bluetooth low energy ble device using tag toolbox partnership request the smartthings find partnership program is available only to registered partners who wish to commercialize you can only do this code lab and get the resources after a successful partnership to form a partnership, contact partners@smartthings com overview the smartthings find partnership program comprises smartthings find device specification, smartthings find device sdk, test tool, and technical support it facilitates the development of devices operating with smartthings find services and mobile applications the smartthings find device sdk is small enough to work on resource-limited microcontroller unit mcu devices in this code lab, you can learn how to develop your own smartthings find device first, you can know how to set up your project in smartthings using the developer workspace next, you can learn how to build your firmware with smartthings find device sdk lastly, you can know how to check the functionalities of your device's rf performance using the tag toolbox app set up your environment you will need the following host pc running on windows 11 visual studio code as the ide smartthings find device sdk code smartthings find tag toolbox smartthings app toolchain for nrf52833 dk use the ncs nrf connect sdk version 2 6 1 nrf52833 dk with buzzer module and nfc antenna galaxy smarttag2 register and deploy to test your device using the smartthings developer workspace, you can create a device profile, customize the instructions for onboarding the device on the smartthings app, and test the devices by deploying them you can edit the configurations until you submit the device for publication in the smartthings ecosystem sign in to smartthings developers go to smartthings developer workspace and sign in using your samsung account select a project and add a device profile select stfind codelab example and check its device profile under the device profile, specify whether the device operates on ble ble and uwb afterward, you can customize your device's onboarding experience in smartthings by uploading your product images, user instructions, and brand name under device onboarding lastly, you can fill in basic product information in the product info deploy your device to test after you complete all of these, you can go back to the overview tab and press deploy to test you can download the tagonboardingconfig h file which includes your project configuration the sdk code needs this configuration file register your devices you can add the identity of your device in the smartthings cloud for authentication this requires device information like serial number and device public key ed25519 when you reach the maximum number of test devices per user, remove the existing ones this example shows how to create an ed25519 key pair with sdk tools in visual studio code, press the tagkeygen button at the bottom afterward, you can generate the serial number, private key, and public key register it to the smartthings cloud using the smartthings developer workspace and include it in your firmware after checking the created information on visual studio code go to the developer workspace go to test > test devices menu, and click register new device input the generated serial number and public key build the firmware with the sdk open visual studio code and build the firmware for your device open the sdk project in the file explorer of visual studio code, you can find four code lab files here when you click the nrf connect icon, it shows important functions such as build, flash, and serial log check the configuration files ensure that two essential configuration files are applied tagonboardingconfig h tagdeviceinfo h write your code in main c, complete the code to call the taginit and tagstart apis of device sdk you can find code_mission in the source code and follow the instructions in the code by simply removing the comments #include <zephyr/zephyr h> #include <zephyr/sys/printk h> #include "tagsdk h" #include "mbedtls/aes h" static void init_aes_table void { mbedtls_aes_context dump_ctx; unsigned char dump_key[16]; mbedtls_aes_setkey_enc &dump_ctx, dump_key, 128 ; } void main void { int err = 0xff; tagresult_t result = tag_result_not_supported; /** * code_mission * you will check this serial log later in this codelab */ printk "tag demo! %s-%s-%s\n", config_board, __date__,__time__ ; init_aes_table ; /** * code_mission * call taginit api by removing comment // * * by calling this api, tag sdk will load nv, set rtc and * initialize crypto, and so on * you shall initialize bsp before call this api * services and starts ble advertising */ // result = taginit ; if result != tag_result_success { printk "failed to init %d\n", result ; return; } err = bt_enable 0 ; if err { printk "failed to init bt %d\n", err ; return; } /** * code_mission * call tagstart api by removing comment // * * by calling this api, tag sdk will initialize ble gatt * db and services and starts ble advertising * you shall initialize ble stack before call this api */ // result = tagstart ; if result != tag_result_success { printk "failed to start maintask %d\n", result ; return; } } in portnfc c, call the seturl function you can find code_mission in the source code and follow the instructions in the code by simply removing the comments tagerror_t portnfcseturl char *url, size_t urllen { tagerror_t ret = tag_error_none; ret = disablenfc ; if ret != tag_error_none { tag_log_e "failed to disable nfc" ; return ret; } /** * code_mission * remove comment // below to call seturl function */ // ret = seturl url, urllen ; if ret != tag_error_none { tag_log_e "failed to set url message" ; return ret; } ret = enablenfc ; if ret != tag_error_none { tag_log_e "failed to enable nfc" ; return ret; } return tag_error_none; } build go to nrf connect > actions click on build noteit may take some time for the build to finish you can see the progress by checking the popup at the bottom-right corner of the ide you can also select nrf connect build in the terminal to check the detailed status flash connect the nrf52833 dk to your computer go to nrf connect > actions click on flash once completed, you can hear a notification sound from your device check the serial log of your device go to nrf connect > connected devices click the plug icon on the right side of vcom0 comxx at the top of the ide, select the first item in the list under connected devices press the reset button briefly on your device by checking the timestamp from the serial log, you can verify whether your device successfully downloaded the firmware onboard and control your device via smartthings app onboard your device launch the smartthings app tap the + icon at the top right of the screen click on add device select add in the partner devices section select my testing devices then, select stfind codelab example to start onboarding allow the use of location information and press agree verify your device by pressing the button on the board in the success! page, tap on done to finish onboarding your device locate and ring your device tap on view map to show the location of your device select ring and your device produces a sound through its buzzer module you may switch to either high-volume or low-volume ringing press stop to stop the ringing configure the lost mode of your device when lost mode is activated, it allows you to view a lost message showing the owner's contact information and any personalized messages in the smartthings app, tap on view map > more > lost mode in the lost mode page, select next add email, contact, and message information then, tap on turn on test it by placing an nfc device or a mobile device at the nfc antenna of your device a lost message should show on your mobile device test the device's rf performance via tag toolbox smartthings find tag toolbox allows you to measure the rf performance of a ble device and log the results create a new test item launch the tag toolbox app on a mobile device tap on ble performance > add new test to create a new test item select a target device and a reference device to compare rf performance a target device this is your device created through this code lab b reference device this is the smarttag2 as a comparison target conduct rf performance tests press start session and check your device's rf performance once completed, tap on take a picture and capture how far away the mobile device is from both your device and the smarttag2 tap on test result to find out your device's rf performance export test result test reports can be exported as a file either during the test or after completing the test check your device's rf performance in the list of session menu a min rssi minimum value of your device's rf signal b max rssi maximum value of your device's rf signal c packet detection rate if the advertising transmission interval is two seconds, it indicates how many packets were detected during the test duration press export test result and it shows the location of the file on your mobile device you're done! congratulations! you have successfully achieved the goal of this code lab topic now, you can develop your own smartthings find-compatible devices to form a partnership, contact partners@smartthings com
Develop Mobile Samsung TEEGRIS
docsamsung teegris a powerful solution to run applications in a trusted execution environment. what is samsung teegris? samsung teegris is a system-wide security solution that allows you to run applications in a trusted execution environment based on trustzone. we present the teegris architecture for external developers to enable their trusted applications and services. samsung mobile uses the teegris framework for several commercial projects. you can utilize the teegris framework to run and deploy your applications. teegris supports trustzone technologies and guarantees the strengths of security (for example, hardware cryptography, binary encryption, access control) and performance (such as multicore, multithreading). in addition, teegris provides a variant of globalplatform apis such as trusted user interface, trusted storage, and so on. teegris provides end-to-end service deployment environments so you can write, manage, and deploy trusted applications on teegris. teegris key features provides you can cryptographic operation no worry about home-made cryptography trusted storage keystore/keymaster safely store your assets in h/w storage trusted user interface safely get user input and show display h/w crypto accelerator enjoy h/w crypto performance mathematical function develop a biometrics matching algorithm network socket connection communicate with your remote server safely multi core behavior get much faster performance pthread execution develop applications with multithreading samsung teegris sdk the samsung teegris sdk is a software development kit for making your trusted applications. it is only available to strategic partners with strategic partnership agreements. please contact m.sec.teesdk@samsung.com if you would like to discuss a strategic partnership with samsung teegris.
Develop GameDev
docgpuwatch introduction gpuwatch is a tool for observing gpu activity in your application gpuwatch is made for developers who use samsung devices to get gpu related information with the least effort detailed information is overlaid onto the screen in real-time and it is very simple to enable -no pc required in the mobile world, the key to a great user experience is performance with efficiency efficient applications have low power requirements which both improves battery life and keeps the device temperature in a comfortable range developers aim to achieve not only higher performance but also better efficiency through optimization to reach these goals it is necessary to measure the current status which is the job of a profiling tool, like gpu watch gpuwatch gives information about gpu work, resource allocation, processor status and more so that developers can get clues about bottlenecks and the best way to fix them then they can finally get the desired performance also they can evaluate the application in many different environments you can utilize gpuwatch in lots of different ways it’s up to you what you will do using this prompt and convenient tool how to use you can easily turn on the gpuwatch overlay for profiling your application settings ⇒ developer options ⇒ gpuwatch on launch the app to measure for further information about functionalities, refer to the userguide page of each version supported devices device android pgpuwatch v1 0 android qgpuwatch v1 5 android rgpuwatch v2 0 } galaxy s9 series △* ✓ ✓ galaxy s10 series ✓ ✓ ✓ galaxy s20 series ✓ ✓ galaxy note9 series △* ✓ ✓ galaxy note10 series ✓ ✓ ✓ galaxy note20 series ✓ ✓ galaxy fold ✓ ✓ ✓ galaxy z flip ✓ ✓ galaxy z fold2 ✓ ✓ other samsung mobile phones ✓ ※ only devices launched in europe and korea
Develop TV Seller Office
doc1 1 q&a categories this guide explains the categories that can be supported through 1 1 q&a service failure if there is a problem with the application service released on the tv, select one of the categories under the 'service failure' category and register your question category description error on tv ask when an error happens on the tv error on seller office ask when an error happens on the tv seller office site table 1 q&a categories for service failure application management if you are having trouble registering and managing applications in the tv seller office, select one of the categories under the 'application management' category and register your question category description certification & defects ask anything about application certification or defects reported application information & status change ask anything about application information and changing its status compatibility ask about application compatibility at new unreleased model groups group management ask anything about managing your groups others ask anything about application management not covered by the above categories table 2 q&a categories for application management tech support if you need technical support for tv application development, select one of the categories under the 'tech support' category and register your question category description sdk install/ide/packaging ask about installation, ide, or packaging of the tizen sdk and the samsung legacy platform sdk emulator/simulator ask about the emulator or simulator for the tizen sdk and the samsung legacy platform sdk api ask about the apis supported by the sdk remote device/debugging ask about tv or debugging on tv smart hub preview sdk ask about the smart hub preview sdk others ask anything about the tizen sdk or the samsung legacy platform sdk not covered by the above categories tizen smart hub preview ask about the smart hub preview features and development vod streaming ask about vod steaming on the tizen tv drm contents ask about drm content playback on the tizen tv smart view sdk ask about the smart view sdk features and development on tizen performance ask about your application performance enhancement on tizen security ask about security issues on tizen platform ask about the tizen platform others ask anything about developing your application on the tizen tv not covered by the above categories samsung legacy platform vod streaming ask about vod steaming on the samsung legacy platform tv drm contents ask about drm content playback on the samsung legacy platform tv smart view sdk ask about the smart view sdk features and development on samsung legacy platform performance ask about your application performance enhancement on samsung legacy platform security ask about security issues on samsung legacy platform platform ask about samsung legacy platform others ask anything about developing your application on the samsung legacy platform tv not covered by the above categories table 3 q&a categories for tech support
tutorials game, mobile
bloganti-aliasing is an important addition to any game to improve visual quality by smoothing out the jagged edges of a scene. msaa (multisample anti-aliasing) is one of the oldest methods to achieve this and is still the preferred solution for mobile. however it is only suitable for forward rendering and, with mobile performance improving year over year, deferred rendering is becoming more common, necessitating the use of post-process aa. this leaves slim pickings as such algorithms tend to be too expensive for mobile gpus with fxaa (fast approximate anti-aliasing) being the only ‘cheap’ option among them. fxaa may be performant enough but it only has simple colour discontinuity shape detection, leading to an often unwanted softening of the image. its kernel is also limited in size, so it struggles to anti-alias longer edges effectively. space module scene with cmaa applied. conservative morphological anti-aliasing conservative morphological anti-aliasing (cmaa) is a post-process aa solution originally developed by intel for their low power integrated gpus 1. its design goals are to be a better alternative to fxaa by: being minimally invasive so it can be acceptable as a replacement in a wide range of applications, including worst case scenarios such as text, repeating patterns, certain geometries (power lines, mesh fences, foliage), and moving images. running efficiently on low-medium range gpu hardware, such as integrated gpus (or, in our case, mobile gpus). we have repurposed this desktop-developed algorithm and come up with a hybrid between the original 1.3 version and the updated 2.0 version 2 to make the best use of mobile hardware. a demo app was created using khronos’ vulkan samples as a framework (which could also be done with gles) to implement this experiment. the sample has a drop down menu for easy switching between the different aa solutions and presents a frametime and bandwidth overlay. cmaa has four basic logical steps: image analysis for colour discontinuities (afterwards stored in a local compressed 'edge' buffer). the method used is not unique to cmaa. extracting locally dominant edges with a small kernel. (unique variation of existing algorithms.) handling of simple shapes. handling of symmetrical long edge shapes. (unique take on the original mlaa shape handling algorithm.) pass 1 edge detection result captured in renderdoc. a full screen edge detection pass is done in a fragment shader and the resulting colour discontinuity values are written into a colour attachment. our implementation uses the pixels’ luminance values to find edge discontinuities for speed and simplicity. an edge exists if the contrast between neighbouring pixels is above an empirically determined threshold. pass 2 neighbouring edges considered for local contrast adaptation. a local contrast adaptation is performed for each detected edge by comparing the value of the previous pass against the values of its closest neighbours by creating a threshold from the average and largest of these, as described by the formula below. any that pass the threshold are written into an image as a confirmed edge. threshold = (avg+avgxy) * (1.0 - nondominantedgeremovalamount) + maxe * (nondominantedgeremovalamount); nondominantedgeremovalamount is another empirically determined variable. pass 3 this pass collects all the edges for each pixel from the previous pass and packs them into a new image for the final pass. this pass also does the first part of edge blending. the detected edges are used to look for 2, 3 and 4 edges in a pixel and then blend in the colours from the adjacent pixels. this helps avoid the unnecessary blending of straight edges. pass 4 the final pass does long edge blending by identifying z-shapes in the detected edges. for each detected z-shape, the length of the edge is traced in both directions until it reaches the end or until it runs into a perpendicular edge. pixel blending is then performed along the traced edges proportional to their distance from the centre. before and after of z-shape detection. results image comparison shows a typical scenario for aa. cmaa manages high quality anti-aliasing while retaining sharpness on straight edges. cmaa demonstrates itself as a superior solution to aliasing than fxaa by avoiding the latter’s limitations. it maintains a crisper look to the overall image and won’t smudge thin lines, all while still providing effective anti-aliasing to curved edges. it also provides a significant performance advantage to qualcomm devices and only a small penalty to arm. image comparison shows a weakness of fxaa where it smudges thin lined geometry into the background. cmaa shows no such weakness and retains the colour of the railing while adding anti-aliasing effectively. msaa is still a clear winner and our recommended solution if your game allows for it to be resolved within a single render pass. for any case where that is impractical, cmaa is overall a better alternative than fxaa and should be strongly considered. graph shows the increase in frametime for each aa method across a range of samsung devices. follow up this site has many resources for developers looking to build for and integrate with samsung devices and services. stay in touch with the latest news by creating a free account or by subscribing to our monthly newsletter. visit the marketing resources page for information on promoting and distributing your apps. finally, our developer forum is an excellent way to stay up-to-date on all things related to the galaxy ecosystem. references filip strugar and leigh davies: conservative morphological anti-aliasing (cmaa) – march 2014. filip strugar and adam t lake: conservative morphological anti-aliasing 2.0 – april 2018.
Samsung GameDev Team
success story design, mobile, ar/vr/xr
bloga new year always seems to bring new opportunities for talented developers. to help our dev community hit the ground running in 2018, we’ve mined insights from some of the industry’s brightest minds for the 2018 source code: a dev’s guide. in this first q&a, vivek vadakkuppattu, product management director at monotype, creator of the popular app flipfont, discusses trends he’s seeing in the world of ar/vr development while sharing his predictions for the upcoming year.with all types of ar/vr devices on the market, what’s the common thread to maintain smooth performance while making efficient use of computing resources? when looking at computing resources, runtime performance has a major impact on streaming and webvr. with this in mind, there are two approaches to building and rendering ar/vr content that will ensure smooth performance, not just across the plethora of devices, but also across use cases and environments. there is currently work happening on both these fronts. first is compression of assets – for example, fonts – so that the size of the app is reduced. the second is rendering optimization to lower resolution in sections of the experience that users don’t focus on. what are your tips for ar/vr developers on app scalability? developers will see the most value by focusing on creating ar/vr apps the “right” way. for example, when implementing text in ar/vr experiences, one common approach is to use bitmaps for text, instead of actual vectors, as a quick, simple way to get a ui up and running. consequently, the text is often of poor quality or requires a lot of manual manipulation, is difficult to localize, or isn’t optimized for the device at hand, thereby limiting scalability. today, however, there are new technologies that enable rendering for high-quality text that can be localized for the user and customized for the device’s screen resolution at hand – all done more efficiently from a resource standpoint. using this technology – and text as vectors – apps can be scaled across devices and geographies more easily than traditional, manual means. fonts that work nicely for websites or print don’t always perform as well in the world of ar/vr. why? ar and vr are immersive, stereoscopic environments where depth plays a major role. therefore, fonts must be chosen carefully to match the tone and genre of the content to enhance the experience without distracting the user. legibility is arguably more important for ar/vr than other mediums. while the aesthetics of fonts are important, choosing highly legible fonts can help mitigate nausea by fostering a more pleasant, comfortable user experience, and enhance readability by letting the user process the text with minimal effort, time or strain. how does monotype’s ar/vr beta solution help with the testing process for font implementation? the monotype ar/vr beta solution makes it easier for developers to create ar/vr experiences with text that is highly legible, localized, customizable (in terms of appearance) and resource optimized. the native support for localization assists with scaling across geographies, and the dynamic customization and resource optimization helps create experiences that scale across devices and platforms. from a font standpoint, we have also identified fonts that offer high legibility, providing developers a resource to find fonts that perform especially well in ar/vr environments. what’s the one big trend that (ar/vr) developers should keep their eyes on in 2018? webvr is a big trend that developers should follow. a major challenge to developing for vr has been the limited footprint of devices in addition to fragmentation of devices and platforms. webvr will democratize vr by making it easier to build scalable content that’s accessible to a wider audience. other trends we’re keeping tabs on are foveated rendering, additional sensory information like smell and touch, and a consolidation of development platforms. thank you to vivek for sharing his thoughts. in the coming weeks, we’ll be talking to more industry experts on what developers need to know moving into 2018, so be sure to like us on facebook and follow us on twitter so you don’t miss an installment of the 2018 source code: a dev’s guide. join the samsung developer program today
Vivek Vadakkuppattu
Develop Smart Signage
doclaunch time optimization this topic presents a case study of improving an application to reduce its launch time it describes the application launch process, techniques for reducing application loading time, and best practices for writing more efficient javascript applications that offer a good user experience ux attract more users users who have positive impressions of an application return to it and are more likely to recommend it to others if you monetize the application, this can result in greater profit application launch time is the total time from the moment when the user clicks the application icon until the application is ready to use improving the application launch time improves the user experience because application loading is the first experience the user gets of your application, a long loading time can leave them with a negative impression therefore, it is worthwhile to prioritize reducing application launch time user satisfaction drastically decreases as the application launch time increases, as shown in the following figure based on a user survey using this information, a target launch time of around 5-7 seconds satisfies most users application launch process the application launch process can be divided into 5 stages some stages are controlled by the system, but most stages are dependent on application implementation, providing opportunities for performance improvement this case study is based on an application running on a 2015 samsung smart tv video was captured while launching the application on the tv, enabling the duration of each application launch stage to be measured with an accuracy of one video frame noteif you want to test your application in a similar way, make sure that all tests are performed under the same circumstances, such as using the same device with the same network conditions, to reduce the effects of external factors the following figure illustrates the application launch stages, and the time spent at each stage for the case study application the following table describes each stage in detail stage action screen time description 1 application icon click 1 086s time between clicking the application icon to when the smart hub "apps" panel disappears 2 initial loading screen 4 979s time between loading the home page "index html" and calling the window onload method 3 black screen 0 837s time a transition screen is shown before calling the window onload method for samsung legacy platform applications only 4 splash image 0 570s time until the splash image appears the splash image is the first screen shown in the application after calling the window onload method it is usually shown during authentication or while content is loading 5 home page 0 348s time taken to render the home page, fill it with content, and enable user input table 1 application launch stages optimizing launch logic this section assumes that the case study application utilizes a framework the framework contains modules responsible for activities, such as sending ajax requests to the backend server, application authorization in the backend side, and modules responsible for the ui and logic the case study application loading process is illustrated in the following figure the application logic is dependent on the framework setup in stages 2 and 3, load and initialize the framework after the framework setup is complete, start authorization at the backend server with the application logic if authorization succeeds, send ajax requests to the backend server to fetch application data, such as a list of recommended movies to display on the application home page ajax requests are dependent on the authorization step, because they must contain an authorization token wait for the data needed to render the home page, and render it this model is not optimized because the entire framework must be loaded and initialized before the application can start the authorization and content loading processes a possible approach to speeding up the launch process is by rebuilding the application in the following way divide the framework setup into 2 phases in the first phase, load the modules responsible for application authorization in the second phase, initialize the rest of the framework once the first phase is loaded, perform authorization immediately it is only dependent on the xhr object created in stage 1 during web runtime setup multiple ajax requests are merged into 1 request to avoid unnecessary delays the ajax request is dependent on the authorization step for the authorization token when the framework is fully initialized, begin performing the basic home page setup without waiting for the ajax request response stage 3 is eliminated completely by migrating the application from samsung legacy platform to tizen padding time is needed to synchronize the application logic and ajax requests the application logic requires ajax request data to render the home page, but as the requests are asynchronous, implement mechanisms to coordinate the modules, such as events, callbacks, and promises resume the application logic after receiving the response from the server load other parts of application logic, such as required scripts and data, on demand in this way, they do not delay the launch process this flow is more optimized, as many tasks are performed in parallel initially, the application loads only the modules which are necessary for authorization and starts authorization immediately along with other operations, such as loading the rest of the framework, the ui, resources, and content any tasks not required for displaying the home page are postponed to start after the launch process consequently, application launch time is much shorter than before improving launch time the following table lists optimization strategies that can improve application launch time, and the application launch stages they affect optimization stage 1 2 3 4 5 migrating application to tizen + + enabling prelaunch + + + + minimizing home page code + + loading js files asynchronously + + sending ajax requests promptly + + parallelizing ajax requests concatenating ajax requests + + + delaying platform and tizen api calls + + caching api output + + + using jquery 2 x or higher + + + loading static resources locally + + minimizing and concatenating code + + removing obsolete code + + using sprites + + + using pure css + + + enforcing gpu acceleration + table 2 launch stages affected by optimizations migrating application to tizen stages affected 1 and 3 tizen is more efficient than samsung legacy platform migrating the application from samsung legacy platform to tizen can improve its performance significantly enabling prelaunch stages affected 1, 2, 4, and 5 tv web applications in tizen support prelaunching applications can load in the background when the samsung tv is switched on when the user launches the application, it loads more quickly because it has been prelaunched for more information, see prelaunching applications minimizing home page code stages affected 2 and 5 application launch time can be improved by loading and parsing less code at launch when the application launches, load only the html, js, and css code necessary to show the home page other code can be loaded on demand using a library, such as require js, to avoid building and parsing the dom before it is needed loading javascript files asynchronously stages affected 2 and 4 when loading external javascript files normally, the html parser stops while the javascript files are downloaded and executed to avoid the pause in html parsing during download, you can use the defer and async attributes <script src='js/main js' defer></script> <script src='js/scripts js' async></script> using the defer attribute downloads the javascript file in parallel while parsing html the javascript code executes only when all html parsing is complete scripts using the defer attribute are guaranteed to execute in the same order that they appear in the document using the async attribute downloads the javascript file in parallel while parsing html, but when the download completes, the html parser pauses to execute the script the defer and async attributes can be used only for scripts implemented with the script element and src attribute for more information, see the html <script> element handling ajax requests you can improve launch time by optimizing ajax request usage sending ajax requests promptly stages affected 2 and 4 most applications load their content from remote servers and utilize a framework that helps manage the requests however, loading and executing the framework code can take a lot of time to speed up application launch, send the ajax requests needed to display the home page as soon as possible you can send a simple xhr request at the beginning of the "index html" file, before loading the framework xhr requests are asynchronous and do not block any other threads cache the response in a global object, so the application framework can use the data immediately to display the home page without sending the request again parallelizing ajax requests send ajax requests in parallel if they are not dependent on responses from prior requests before each request is executed after receiving a response from the previous one sendrequest1 onsuccess sendrequest2 onsuccess sendrequest3 onsuccess sendrequest4 onsuccess sendrequest5 after the first request authorizes the application after receiving the response, the other requests are executed asynchronously sendrequest1 onsuccess sendrequest2 sendrequest3 sendrequest4 sendrequest5 concatenating ajax requests stages affected 2, 4, and 5 limit the number of ajax requests by merging several requests, if possible the fewer requests there are, the less time it takes to process all of them for example, consider an application that sends 3 requests to display the home page, such as for application authorization, a list of recommended movies, and a list of the latest movies verify whether it is possible to modify the requests and backend in such a way that the response for the authorization request contains the recommended and latest movies as well you can also use this strategy throughout the application to reduce the loading time of other scenes delaying platform and tizen api calls stages affected 2 and 4 many applications make early calls to tizen and platform apis for static information, such as the duid or model code because api initialization is "lazy" the api is initialized only when it is first needed , the first call to each api module takes time postpone api calls until the application is fully started and ready to use, if possible caching api output stages affected 2, 4, and 5 instead of querying the api each time, cache the static output from product and tizen apis in javascript variables consider the following scenarios the total duration of video content is constant during video playback you can retrieve it once and store it in a javascript variable instead of querying the api each time it is needed tv specification parameters, such as the duid or model code, never change you can retrieve the parameters using the api the first time the application is launched and save it in localstorage retrieving data from localstorage is quicker than querying the api using jquery 2 x or higher stages affected 2, 4, and 5 newer versions of jquery are smaller and faster you can also consider using a custom jquery build loading static resources locally stages affected 2 and 4 load static application resources directly from the local file system, by including all application source code, external libraries, and static ui elements, such as css and images, within the tizen package before <link rel='stylesheet' href='https //maxcdn bootstrapcdn com/bootstrap/3 3 5/css/bootstrap min css'> <link rel='stylesheet' href='https //example com/myapp/css/styles min css'> <script src='http //code jquery com/jquery-2 0 0 min js'></script> <script src='https //maxcdn bootstrapcdn com/bootstrap/3 3 5/js/bootstrap min js'></script> after <link rel='stylesheet' href='css/bootstrap min css'> <link rel='stylesheet' href='css/styles min css'> <script src='js/jquery-2 0 0 min js'></script> <script src='js/bootstrap min js'></script> this not only decreases loading time, but can also improve application security and eliminate some application errors caused by network issues minimizing and concatenating code stages affected 2 and 4 the application loads faster when it makes fewer requests to the file system if you do not want to use a lazy loading mechanism to load parts of the application on demand, concatenate and minimize your source code, especially javascript and css files before <!doctype html> <html lang='en'> <head> <meta name='viewport' content='width=1280, user-scalable=no'> <meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>my application</title> <link rel='stylesheet' type='text/css' href='styles/main css'> <link rel='stylesheet' type='text/css' href='styles/list css'> <link rel='stylesheet' type='text/css' href='styles/player css'> <link rel='stylesheet' type='text/css' href='styles/login css'> <link rel='stylesheet' type='text/css' href='styles/account css'> <script src='js/main js'></script> <script src='js/list js'></script> <script src='js/player js'></script> <script src='js/login js'></script> <script src='js/account js'></script> </head> <body> <div id='menu'></div> <div id='maincontainer'> <div id='helpbar'></div> </body> </html> after<!doctype html> <html lang='en'> <head> <meta name='viewport' content='width=1280, user-scalable=no'> <meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>my application</title> <link rel='stylesheet' type='text/css' href='styles/all_styles css'/> <script src='js/all_scripts js' defer></script> </head> <body> <div id='menu'></div> <div id='maincontainer'> <div id='helpbar'></div> </body> </html> in some situations, it can be better to concatenate your code into 2 files instead of 1 if the code must be executed as soon as possible, put it into a file that is loaded with the async attribute if the code requires the dom to be ready before execution, put it in another file that is loaded with the defer attribute make sure that the code loads in the correct order to satisfy its dependencies removing obsolete code stages affected 2 and 4 if the application loads any unused source code, whether it is javascript, css, or html, the browser takes time to parse it, build the dom, and search the html code for matching css rules keep your code clean and up to date to avoid unnecessary performance issues caused by obsolete or redundant code for example, when the window onload method is called, calling the unregisterkey method of the tvinputdevice api is unnecessary because no keys are registered other than the default "left", "up", "right", "down", "enter", and "back" keys using sprites stages affected 2, 4, and 5 if your application loads many small graphics, such as icons, button elements, and backgrounds, consider using css sprites css sprites help images load faster by making fewer requests to the file system, which improves overall application performance you can merge all of the icons or background images into 1 large image and use css to set the positions for each element consider the following mouse hover implementation before #mybutton { width 300px; height 100px; background url 'img/button-normal png' 0px 0px no-repeat; } #mybutton hover { background url 'img/button-hover png' 0px 0px no-repeat; } this code is not optimal, as the browser must make 2 requests to the file system instead of 1 additionally, the first time the user hovers on the button, its background will flicker, as some time is needed to request the new image and show it on the screen after #mybutton { width 300px; height 100px; background url 'img/button-sprite png' 0px 0px no-repeat; } #mybutton hover { background url 'img/button-sprite png' 0px -100px no-repeat; } this code is more optimal because it loads only 1 image which takes less time to load, even though its size is bigger mouse hover changes only the background image position, so there is no flickering when switching between the states using pure css stages affected 2, 4, and 5 tizen supports css3, which allows you to create many graphic effects without using image files pure css renders faster and takes less time to calculate its properties, which is especially valuable when animating css elements the following code creates a button using only pure css button { width 180px; height 62px; line-height 62px; font-size 24px; color #fff; text-align center; text-shadow 1px 0 1px rgba 0, 0, 0, 75 ; background -webkit-linear-gradient top, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100% ; border solid 2px #fff; border-radius 12px; box-shadow 0px 0px 15px 5px rgba 255, 255, 190, 75 ; } enforcing gpu acceleration stage affected 5 normally, the browser applies gpu acceleration when there is some indication that a dom element can benefit from it css3 allows you to force the browser to render elements with gpu acceleration one of the simplest methods is setting a style indicating 3d transform, even when no real 3d transformation is applied acceleratedelem { -webkit-transform translatez 0 ; } in general, 3d transformations in css force the browser to use the gpu the following declarations can reduce flickering during css transforms or animations acceleratedelem { -webkit-backface-visibility hidden; -webkit-perspective 1000; } for more information, see an introduction to css 3-d transforms and increase site performance with hardware-accelerated css optimizing javascript code follow a reliable and consistent coding standard and style for javascript, as it makes the code easier to write, easier to read, improves its maintainability, and makes it less error-prone the following section presents javascript best practices that are frequently used in the web community caching dom element references searching the dom tree is a resource-hungry operation if there are dom elements on which you perform operations frequently, store them in javascript variables to avoid repetitive dom traversal prefer var elem1 = document getelementbyid 'elem1' ; elem1 innerhtml = 'lorem ipsum dolor'; elem1 classlist remove 'class1' ; elem1 classlist add 'class2' ; var $elem2 = $ '#elem2' ; $elem2 html 'lorem ipsum dolor sit amet' ; $elem2 addclass 'class3' ; avoid document getelementbyid 'elem1' innerhtml = 'lorem ipsum dolor'; document getelementbyid 'elem1' classlist remove 'class1' ; document getelementbyid 'elem1' classlist add 'class2' ; $ '#elem2' html 'lorem ipsum dolor sit amet' ; $ '#elem2' addclass 'class3' ; it can be helpful to store references to frequently-used dom elements in a global object for example var domelementscache = { eldocument window document, elhtml window document documentelement, elbody window document body, elhead window document head, eltitle window document getelementbyid 'title' }; domelementscache eltitle innerhtml 'my title' ; avoiding slow jquery selectors jquery selectors work slower than native ones if application performance is critical, consider replacing jquery selectors, for example id selector //jquery var elem = $ '#myelem' ; //native js equivalent var elem = document queryselector '#myelem' ; class selector //jquery var elems = $ ' class1' ; //native js equivalent var elems = document queryselectorall ' class1' ; tagname selector //jquery var elems = $ 'span' ; //native js equivalent var elems = document queryselectorall 'span' ; $ find //jquery var elems = $el find ' target1, target2, target3' ; //native js equivalent var elems = el queryselectorall ' target1, target2, target3' ; using native methods native javascript methods are faster than wrappers from different libraries in some cases, it can be helpful to use them instead of library methods var myarray = [1, 2, 3]; //underscore _ each myarray, function val { console log val ; } ; //jquery $ each myarray, function val { console log val ; } ; //native js equivalent for var i = 0; i < myarray length; i++ { console log myarray[i] ; } removing console logging extensive logging decreases application performance, because each console log method call blocks the javascript thread in the browser other logging methods, such as the console warn , console info , console error methods, behave similarly to improve application performance, remove log methods in the final build you can use a logger utility to easily switch logging on and off open source libraries, such as woodman, are available, or you can write your own logger, such as the following example // global object for storing application configuration var applicationconfig = { debugmode true //enables logs in application }; // logger object factory var logger = function { var logger = {}; if applicationconfig debugmode === true { logger = { log function { var args = array prototype slice call arguments, 0 ; console log args ; }, info function { var args = array prototype slice call arguments, 0 ; console info args ; }, warn function { var args = array prototype slice call arguments, 0 ; console warn args ; }, error function { var args = array prototype slice call arguments, 0 ; console error args ; } }; } else { logger = { log function {}, info function {}, warn function {}, error function {} }; } return logger; }; // usage // for development and debugging var applicationconfig = { debugmode true }; var mylog = new logger ; // initializes logger mylog log 'test' ; // outputs 'test' to console //for production var applicationconfig = { debugmode false }; var mylog = new logger ; // initializes logger mylog log 'test' ; // does nothing importantnever override console log or any other native function overriding native objects is a bad practice in javascript, as it can lead to unexpected behavior and introduce defects that are very hard to debug optimization results the principles described in this guide were applied to several samsung tv applications, as listed in the following table optimization application a b c d e f migrating application to tizen + + + + + + enabling prelaunch + + + + + + minimizing home page code + + + + + + loading js files asynchronously + + + + + + sending ajax requests promptly + + + + parallelizing ajax requests + + + concatenating ajax requests + + delaying platform and tizen api calls + + + + + caching api output + + + + using jquery 2 x or higher + + + + loading static resources locally minimizing and concatenating code + + + + + + removing obsolete code + + + using sprites + + + + + + using pure css + enforcing gpu acceleration + caching dom element references + + + + + + avoiding slow jquery selectors + + + using native methods + + removing console logging + + + + + table 3 optimizations applied to samsung tv applications the following table lists the launch time optimization results application beforeoptimization afteroptimization reduction reduction % a 7 234 s 4 422 s 2 812 s 38 87% b 6 972 s 4 642 s 2 330 s 33 42% c 4 160 s 3 140 s 1 020 s 24 52% d 16 512 s 4 011 s 12 501 s 75 71% e 4 090 s 3 153 s 0 937 s 22 91% f 17 853 s 7 462 s 10 391 s 58 20% average reduction 4 999 s 42 27% table 4 results of application launch time optimization the average reduction in application launch time was almost 5 seconds, a 42% improvement this result suggests that it is worthwhile to optimize applications, wherever possible
Develop Smart Hospitality Display
doclaunch time optimization this topic presents a case study of improving an application to reduce its launch time it describes the application launch process, techniques for reducing application loading time, and best practices for writing more efficient javascript applications that offer a good user experience ux attract more users users who have positive impressions of an application return to it and are more likely to recommend it to others if you monetize the application, this can result in greater profit application launch time is the total time from the moment when the user clicks the application icon until the application is ready to use improving the application launch time improves the user experience because application loading is the first experience the user gets of your application, a long loading time can leave them with a negative impression therefore, it is worthwhile to prioritize reducing application launch time user satisfaction drastically decreases as the application launch time increases, as shown in the following figure based on a user survey using this information, a target launch time of around 5-7 seconds satisfies most users application launch process the application launch process can be divided into 5 stages some stages are controlled by the system, but most stages are dependent on application implementation, providing opportunities for performance improvement this case study is based on an application running on a 2015 samsung smart tv video was captured while launching the application on the tv, enabling the duration of each application launch stage to be measured with an accuracy of one video frame noteif you want to test your application in a similar way, make sure that all tests are performed under the same circumstances, such as using the same device with the same network conditions, to reduce the effects of external factors the following figure illustrates the application launch stages, and the time spent at each stage for the case study application the following table describes each stage in detail stage action screen time description 1 application icon click 1 086s time between clicking the application icon to when the smart hub "apps" panel disappears 2 initial loading screen 4 979s time between loading the home page "index html" and calling the window onload method 3 black screen 0 837s time a transition screen is shown before calling the window onload method for samsung legacy platform applications only 4 splash image 0 570s time until the splash image appears the splash image is the first screen shown in the application after calling the window onload method it is usually shown during authentication or while content is loading 5 home page 0 348s time taken to render the home page, fill it with content, and enable user input table 1 application launch stages optimizing launch logic this section assumes that the case study application utilizes a framework the framework contains modules responsible for activities, such as sending ajax requests to the backend server, application authorization in the backend side, and modules responsible for the ui and logic the case study application loading process is illustrated in the following figure the application logic is dependent on the framework setup in stages 2 and 3, load and initialize the framework after the framework setup is complete, start authorization at the backend server with the application logic if authorization succeeds, send ajax requests to the backend server to fetch application data, such as a list of recommended movies to display on the application home page ajax requests are dependent on the authorization step, because they must contain an authorization token wait for the data needed to render the home page, and render it this model is not optimized because the entire framework must be loaded and initialized before the application can start the authorization and content loading processes a possible approach to speeding up the launch process is by rebuilding the application in the following way divide the framework setup into 2 phases in the first phase, load the modules responsible for application authorization in the second phase, initialize the rest of the framework once the first phase is loaded, perform authorization immediately it is only dependent on the xhr object created in stage 1 during web runtime setup multiple ajax requests are merged into 1 request to avoid unnecessary delays the ajax request is dependent on the authorization step for the authorization token when the framework is fully initialized, begin performing the basic home page setup without waiting for the ajax request response stage 3 is eliminated completely by migrating the application from samsung legacy platform to tizen padding time is needed to synchronize the application logic and ajax requests the application logic requires ajax request data to render the home page, but as the requests are asynchronous, implement mechanisms to coordinate the modules, such as events, callbacks, and promises resume the application logic after receiving the response from the server load other parts of application logic, such as required scripts and data, on demand in this way, they do not delay the launch process this flow is more optimized, as many tasks are performed in parallel initially, the application loads only the modules which are necessary for authorization and starts authorization immediately along with other operations, such as loading the rest of the framework, the ui, resources, and content any tasks not required for displaying the home page are postponed to start after the launch process consequently, application launch time is much shorter than before improving launch time the following table lists optimization strategies that can improve application launch time, and the application launch stages they affect optimization stage 1 2 3 4 5 migrating application to tizen + + enabling prelaunch + + + + minimizing home page code + + loading js files asynchronously + + sending ajax requests promptly + + parallelizing ajax requests concatenating ajax requests + + + delaying platform and tizen api calls + + caching api output + + + using jquery 2 x or higher + + + loading static resources locally + + minimizing and concatenating code + + removing obsolete code + + using sprites + + + using pure css + + + enforcing gpu acceleration + table 2 launch stages affected by optimizations migrating application to tizen stages affected 1 and 3 tizen is more efficient than samsung legacy platform migrating the application from samsung legacy platform to tizen can improve its performance significantly enabling prelaunch stages affected 1, 2, 4, and 5 tv web applications in tizen support prelaunching applications can load in the background when the samsung tv is switched on when the user launches the application, it loads more quickly because it has been prelaunched for more information, see prelaunching applications minimizing home page code stages affected 2 and 5 application launch time can be improved by loading and parsing less code at launch when the application launches, load only the html, js, and css code necessary to show the home page other code can be loaded on demand using a library, such as require js, to avoid building and parsing the dom before it is needed loading javascript files asynchronously stages affected 2 and 4 when loading external javascript files normally, the html parser stops while the javascript files are downloaded and executed to avoid the pause in html parsing during download, you can use the defer and async attributes <script src='js/main js' defer></script> <script src='js/scripts js' async></script> using the defer attribute downloads the javascript file in parallel while parsing html the javascript code executes only when all html parsing is complete scripts using the defer attribute are guaranteed to execute in the same order that they appear in the document using the async attribute downloads the javascript file in parallel while parsing html, but when the download completes, the html parser pauses to execute the script the defer and async attributes can be used only for scripts implemented with the script element and src attribute for more information, see the html <script> element handling ajax requests you can improve launch time by optimizing ajax request usage sending ajax requests promptly stages affected 2 and 4 most applications load their content from remote servers and utilize a framework that helps manage the requests however, loading and executing the framework code can take a lot of time to speed up application launch, send the ajax requests needed to display the home page as soon as possible you can send a simple xhr request at the beginning of the "index html" file, before loading the framework xhr requests are asynchronous and do not block any other threads cache the response in a global object, so the application framework can use the data immediately to display the home page without sending the request again parallelizing ajax requests send ajax requests in parallel if they are not dependent on responses from prior requests before each request is executed after receiving a response from the previous one sendrequest1 onsuccess sendrequest2 onsuccess sendrequest3 onsuccess sendrequest4 onsuccess sendrequest5 after the first request authorizes the application after receiving the response, the other requests are executed asynchronously sendrequest1 onsuccess sendrequest2 sendrequest3 sendrequest4 sendrequest5 concatenating ajax requests stages affected 2, 4, and 5 limit the number of ajax requests by merging several requests, if possible the fewer requests there are, the less time it takes to process all of them for example, consider an application that sends 3 requests to display the home page, such as for application authorization, a list of recommended movies, and a list of the latest movies verify whether it is possible to modify the requests and backend in such a way that the response for the authorization request contains the recommended and latest movies as well you can also use this strategy throughout the application to reduce the loading time of other scenes delaying platform and tizen api calls stages affected 2 and 4 many applications make early calls to tizen and platform apis for static information, such as the duid or model code because api initialization is "lazy" the api is initialized only when it is first needed , the first call to each api module takes time postpone api calls until the application is fully started and ready to use, if possible caching api output stages affected 2, 4, and 5 instead of querying the api each time, cache the static output from product and tizen apis in javascript variables consider the following scenarios the total duration of video content is constant during video playback you can retrieve it once and store it in a javascript variable instead of querying the api each time it is needed tv specification parameters, such as the duid or model code, never change you can retrieve the parameters using the api the first time the application is launched and save it in localstorage retrieving data from localstorage is quicker than querying the api using jquery 2 x or higher stages affected 2, 4, and 5 newer versions of jquery are smaller and faster you can also consider using a custom jquery build loading static resources locally stages affected 2 and 4 load static application resources directly from the local file system, by including all application source code, external libraries, and static ui elements, such as css and images, within the tizen package before <link rel='stylesheet' href='https //maxcdn bootstrapcdn com/bootstrap/3 3 5/css/bootstrap min css'> <link rel='stylesheet' href='https //example com/myapp/css/styles min css'> <script src='http //code jquery com/jquery-2 0 0 min js'></script> <script src='https //maxcdn bootstrapcdn com/bootstrap/3 3 5/js/bootstrap min js'></script> after <link rel='stylesheet' href='css/bootstrap min css'> <link rel='stylesheet' href='css/styles min css'> <script src='js/jquery-2 0 0 min js'></script> <script src='js/bootstrap min js'></script> this not only decreases loading time, but can also improve application security and eliminate some application errors caused by network issues minimizing and concatenating code stages affected 2 and 4 the application loads faster when it makes fewer requests to the file system if you do not want to use a lazy loading mechanism to load parts of the application on demand, concatenate and minimize your source code, especially javascript and css files before <!doctype html> <html lang='en'> <head> <meta name='viewport' content='width=1280, user-scalable=no'> <meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>my application</title> <link rel='stylesheet' type='text/css' href='styles/main css'> <link rel='stylesheet' type='text/css' href='styles/list css'> <link rel='stylesheet' type='text/css' href='styles/player css'> <link rel='stylesheet' type='text/css' href='styles/login css'> <link rel='stylesheet' type='text/css' href='styles/account css'> <script src='js/main js'></script> <script src='js/list js'></script> <script src='js/player js'></script> <script src='js/login js'></script> <script src='js/account js'></script> </head> <body> <div id='menu'></div> <div id='maincontainer'> <div id='helpbar'></div> </body> </html> after<!doctype html> <html lang='en'> <head> <meta name='viewport' content='width=1280, user-scalable=no'> <meta http-equiv='content-type' content='text/html; charset=utf-8'> <title>my application</title> <link rel='stylesheet' type='text/css' href='styles/all_styles css'/> <script src='js/all_scripts js' defer></script> </head> <body> <div id='menu'></div> <div id='maincontainer'> <div id='helpbar'></div> </body> </html> in some situations, it can be better to concatenate your code into 2 files instead of 1 if the code must be executed as soon as possible, put it into a file that is loaded with the async attribute if the code requires the dom to be ready before execution, put it in another file that is loaded with the defer attribute make sure that the code loads in the correct order to satisfy its dependencies removing obsolete code stages affected 2 and 4 if the application loads any unused source code, whether it is javascript, css, or html, the browser takes time to parse it, build the dom, and search the html code for matching css rules keep your code clean and up to date to avoid unnecessary performance issues caused by obsolete or redundant code for example, when the window onload method is called, calling the unregisterkey method of the tvinputdevice api is unnecessary because no keys are registered other than the default "left", "up", "right", "down", "enter", and "back" keys using sprites stages affected 2, 4, and 5 if your application loads many small graphics, such as icons, button elements, and backgrounds, consider using css sprites css sprites help images load faster by making fewer requests to the file system, which improves overall application performance you can merge all of the icons or background images into 1 large image and use css to set the positions for each element consider the following mouse hover implementation before #mybutton { width 300px; height 100px; background url 'img/button-normal png' 0px 0px no-repeat; } #mybutton hover { background url 'img/button-hover png' 0px 0px no-repeat; } this code is not optimal, as the browser must make 2 requests to the file system instead of 1 additionally, the first time the user hovers on the button, its background will flicker, as some time is needed to request the new image and show it on the screen after #mybutton { width 300px; height 100px; background url 'img/button-sprite png' 0px 0px no-repeat; } #mybutton hover { background url 'img/button-sprite png' 0px -100px no-repeat; } this code is more optimal because it loads only 1 image which takes less time to load, even though its size is bigger mouse hover changes only the background image position, so there is no flickering when switching between the states using pure css stages affected 2, 4, and 5 tizen supports css3, which allows you to create many graphic effects without using image files pure css renders faster and takes less time to calculate its properties, which is especially valuable when animating css elements the following code creates a button using only pure css button { width 180px; height 62px; line-height 62px; font-size 24px; color #fff; text-align center; text-shadow 1px 0 1px rgba 0, 0, 0, 75 ; background -webkit-linear-gradient top, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100% ; border solid 2px #fff; border-radius 12px; box-shadow 0px 0px 15px 5px rgba 255, 255, 190, 75 ; } enforcing gpu acceleration stage affected 5 normally, the browser applies gpu acceleration when there is some indication that a dom element can benefit from it css3 allows you to force the browser to render elements with gpu acceleration one of the simplest methods is setting a style indicating 3d transform, even when no real 3d transformation is applied acceleratedelem { -webkit-transform translatez 0 ; } in general, 3d transformations in css force the browser to use the gpu the following declarations can reduce flickering during css transforms or animations acceleratedelem { -webkit-backface-visibility hidden; -webkit-perspective 1000; } for more information, see an introduction to css 3-d transforms and increase site performance with hardware-accelerated css optimizing javascript code follow a reliable and consistent coding standard and style for javascript, as it makes the code easier to write, easier to read, improves its maintainability, and makes it less error-prone the following section presents javascript best practices that are frequently used in the web community caching dom element references searching the dom tree is a resource-hungry operation if there are dom elements on which you perform operations frequently, store them in javascript variables to avoid repetitive dom traversal prefer var elem1 = document getelementbyid 'elem1' ; elem1 innerhtml = 'lorem ipsum dolor'; elem1 classlist remove 'class1' ; elem1 classlist add 'class2' ; var $elem2 = $ '#elem2' ; $elem2 html 'lorem ipsum dolor sit amet' ; $elem2 addclass 'class3' ; avoid document getelementbyid 'elem1' innerhtml = 'lorem ipsum dolor'; document getelementbyid 'elem1' classlist remove 'class1' ; document getelementbyid 'elem1' classlist add 'class2' ; $ '#elem2' html 'lorem ipsum dolor sit amet' ; $ '#elem2' addclass 'class3' ; it can be helpful to store references to frequently-used dom elements in a global object for example var domelementscache = { eldocument window document, elhtml window document documentelement, elbody window document body, elhead window document head, eltitle window document getelementbyid 'title' }; domelementscache eltitle innerhtml 'my title' ; avoiding slow jquery selectors jquery selectors work slower than native ones if application performance is critical, consider replacing jquery selectors, for example id selector //jquery var elem = $ '#myelem' ; //native js equivalent var elem = document queryselector '#myelem' ; class selector //jquery var elems = $ ' class1' ; //native js equivalent var elems = document queryselectorall ' class1' ; tagname selector //jquery var elems = $ 'span' ; //native js equivalent var elems = document queryselectorall 'span' ; $ find //jquery var elems = $el find ' target1, target2, target3' ; //native js equivalent var elems = el queryselectorall ' target1, target2, target3' ; using native methods native javascript methods are faster than wrappers from different libraries in some cases, it can be helpful to use them instead of library methods var myarray = [1, 2, 3]; //underscore _ each myarray, function val { console log val ; } ; //jquery $ each myarray, function val { console log val ; } ; //native js equivalent for var i = 0; i < myarray length; i++ { console log myarray[i] ; } removing console logging extensive logging decreases application performance, because each console log method call blocks the javascript thread in the browser other logging methods, such as the console warn , console info , console error methods, behave similarly to improve application performance, remove log methods in the final build you can use a logger utility to easily switch logging on and off open source libraries, such as woodman, are available, or you can write your own logger, such as the following example // global object for storing application configuration var applicationconfig = { debugmode true //enables logs in application }; // logger object factory var logger = function { var logger = {}; if applicationconfig debugmode === true { logger = { log function { var args = array prototype slice call arguments, 0 ; console log args ; }, info function { var args = array prototype slice call arguments, 0 ; console info args ; }, warn function { var args = array prototype slice call arguments, 0 ; console warn args ; }, error function { var args = array prototype slice call arguments, 0 ; console error args ; } }; } else { logger = { log function {}, info function {}, warn function {}, error function {} }; } return logger; }; // usage // for development and debugging var applicationconfig = { debugmode true }; var mylog = new logger ; // initializes logger mylog log 'test' ; // outputs 'test' to console //for production var applicationconfig = { debugmode false }; var mylog = new logger ; // initializes logger mylog log 'test' ; // does nothing importantnever override console log or any other native function overriding native objects is a bad practice in javascript, as it can lead to unexpected behavior and introduce defects that are very hard to debug optimization results the principles described in this guide were applied to several samsung tv applications, as listed in the following table optimization application a b c d e f migrating application to tizen + + + + + + enabling prelaunch + + + + + + minimizing home page code + + + + + + loading js files asynchronously + + + + + + sending ajax requests promptly + + + + parallelizing ajax requests + + + concatenating ajax requests + + delaying platform and tizen api calls + + + + + caching api output + + + + using jquery 2 x or higher + + + + loading static resources locally minimizing and concatenating code + + + + + + removing obsolete code + + + using sprites + + + + + + using pure css + enforcing gpu acceleration + caching dom element references + + + + + + avoiding slow jquery selectors + + + using native methods + + removing console logging + + + + + table 3 optimizations applied to samsung tv applications the following table lists the launch time optimization results application beforeoptimization afteroptimization reduction reduction % a 7 234 s 4 422 s 2 812 s 38 87% b 6 972 s 4 642 s 2 330 s 33 42% c 4 160 s 3 140 s 1 020 s 24 52% d 16 512 s 4 011 s 12 501 s 75 71% e 4 090 s 3 153 s 0 937 s 22 91% f 17 853 s 7 462 s 10 391 s 58 20% average reduction 4 999 s 42 27% table 4 results of application launch time optimization the average reduction in application launch time was almost 5 seconds, a 42% improvement this result suggests that it is worthwhile to optimize applications, wherever possible
Design One UI Watch for Tizen
docbuttons tap a button to perform an action. buttons can appear on almost any screen, should be easy to tap, and are designed according to the purpose of an action. usage use a bottom button when providing one important action on a screen we recommend using a bottom button when you only provide one major function on a screen. if you don’t have enough space for a bottom button, use a text button instead. use more options when providing multiple actions if you need multiple buttons on one screen, move any less important actions to more options. behavior tap a button performs an action or opens a link a button should look tappable so users know intuitively to tap it. buttons should be disabled if they can’t be tapped disable a button if, in the current condition, it’s not able to perform an assigned action. for example, if no item is selected from a list, any share or delete buttons should be dimmed to indicate that they’re not active. types bottom buttons a bottom button provides one main action. it remains fixed and non-scrollable at the bottom of the screen. to aid in readability, the text should be capitalized like a sentence, when applicable. only use icon when you can't fit long text in the button field. bottom button in developer's guides native button > bottom web bottom button contained buttons the contained button is a rounded rectangle with text. depending on the importance of the button, color contained buttons and gray contained buttons can be used selectively. the color contained button can be used for the most important primary action on the screen (for example, okay, next, or do). the gray contained button can be used for actions that are relatively less important or contrary to the primary action (for example, cancle, previous, or don't). text buttons the text button consists of text and the "greater than" character (>). text buttons can be used for actions that are less important than contained buttons. if the contained button and text button are used together on one screen, the color contained button, gray contained button, and text button can be selectively used depending on the importance of each action. select mode buttons these buttons appear when users select items from a list. disable these buttons if there’s a limit to the number of items users can select, or if no item is selected. selection mode action button in developer's guides native (circle) ui components (+ sdk : ctxpopup) web ― list buttons list buttons present action options for an item in a list through an icon. display an icon with text when there’s only one list button for one list item, but remove the text when there are 2-3 buttons for a list item. design specs bottom button text button select mode action button list button more options
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
These cookies collect information about how you use our website. for example which pages you visit most often. All information these cookies collect is used to improve how the website works.
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and tailor the website to provide enhanced features and content for you.
These cookies gather information about your browser habits. They remember that you've visited our website and share this information with other organizations such as advertisers.
You have successfully updated your cookie preferences.