{"id":482,"date":"2015-10-26T10:02:35","date_gmt":"2015-10-26T10:02:35","guid":{"rendered":"http:\/\/www.sphinx-solution.com\/blog\/?p=482"},"modified":"2024-09-30T11:15:22","modified_gmt":"2024-09-30T11:15:22","slug":"apple-open-source-language-swift-to-develop-android-app","status":"publish","type":"post","link":"https:\/\/www.sphinx-solution.com\/blog\/apple-open-source-language-swift-to-develop-android-app\/","title":{"rendered":"Apple\u2019s Open Source Language \u201cSWIFT\u201d Good Ugly or Bad to Develop Android App"},"content":{"rendered":"<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_SWIFT\"><\/span>What is SWIFT?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Swift is a new multi-paradigm programming language used to develop iOS, OS X, watchOS and further available for <a href=\"https:\/\/www.sphinx-solution.com\/android-apps-development\/\">developing Android apps<\/a>. It is considered as much safer than C and Objective-C, the added features help&nbsp;in programming easier&amp; more flexible. Swift&rsquo;s clean slate is supported by Cocoa and Cocoa Touch frameworks which empower developers to preview how the software is working.<\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"><\/path><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1 \"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.sphinx-solution.com\/blog\/apple-open-source-language-swift-to-develop-android-app\/#What_is_SWIFT\" title=\"What is SWIFT?\">What is SWIFT?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.sphinx-solution.com\/blog\/apple-open-source-language-swift-to-develop-android-app\/#SWIFT_to_be_Used_to_Develop_Android_Apps\" title=\"SWIFT to be Used to Develop Android Apps\">SWIFT to be Used to Develop Android Apps<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.sphinx-solution.com\/blog\/apple-open-source-language-swift-to-develop-android-app\/#Targeting_Android\" title=\"Targeting Android\">Targeting Android<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.sphinx-solution.com\/blog\/apple-open-source-language-swift-to-develop-android-app\/#Can_We_Develop_Cross-Platform_Apps_with_SWIFT\" title=\"Can We Develop Cross-Platform Apps with SWIFT?\">Can We Develop Cross-Platform Apps with SWIFT?<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.sphinx-solution.com\/blog\/apple-open-source-language-swift-to-develop-android-app\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<p>Swift uses Objective-C runtime which allows C, Objective C, C++, and Swift code to run together. It is built with the LLVM compiler framework available in Xcode 6. It is more about protocol-oriented programming which incorporates the concept of protocol extensibility that can be applied- structs and classes.<\/p>\n\n\n\n<p>Apple introduced SWIFT at its World Wide Developer Conference. In 2015 WWDC- 2015, it was announced to be&#xA0;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Open_source\" rel=\"nofollow\">open source<\/a>&#xA0;later that year, supporting iOS, OS X, and&#xA0;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Linux\" rel=\"nofollow\">Linux<\/a>.<\/p>\n\n\n\n<p>Swift is considered as the future of <a href=\"https:\/\/www.sphinx-solution.com\/ios-app-development\/\">iOS Development<\/a>. Apple did enough of the groundwork to put a strong foundation for Swift by fostering their compiler, debugger, and framework infrastructure. With the implication of Automatic Reference Counting (ARC) Apple has simplified memory management.<\/p>\n\n\n\n<p>The developers who are familiar with Objective C, Swift is enjoyable for them. Empowered with dynamic object model and inherits readability mix matches interoperability of Objective-C, SWIFT provides seamless access to existing Cocoa frameworks and unifies the procedural and object-oriented portions of the language. It supports a playground feature that allows developers to experiment and see the results immediately, without the overhead of building and running an app.<\/p>\n\n\n\n<p>The compiler and language, both are optimized for performance and development, respectively without compromising on either. Swift is highly scalable, you can create a simple program for a complex operating system. Having so much exciting features Swift comprise all is a fantastic way to write iOS, OS X, and watchOS apps.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SWIFT_to_be_Used_to_Develop_Android_Apps\"><\/span>SWIFT to be Used to Develop Android Apps<span class=\"ez-toc-section-end\"><\/span><\/h2>&#13;\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps.webp\"><img decoding=\"async\" class=\"alignnone wp-image-4529 size-full\" src=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps.webp\" alt=\"develop-android-apps\" width=\"2100\" height=\"1200\" srcset=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps.webp 2100w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-300x171.webp 300w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-1024x585.webp 1024w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-768x439.webp 768w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-1536x878.webp 1536w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-2048x1170.webp 2048w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-360x206.webp 360w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/develop-android-apps-750x429.webp 750w\" sizes=\"(max-width: 2100px) 100vw, 2100px\"\/><\/a><\/p>\n\n\n\n\n\n<p>Apple has taken the decision to make SWIFT as an open source language. Its compiler is built on LLVM is a compiler infrastructure that leverages the concept of a retargetable compiler. Instead of generating machine code LLVM generates assembly code and then converts that intermediate representation of the actual code.<\/p>\n\n\n\n<div class=\"wp-block-image\" style=\"text-align: center;\">&#13;\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/llvm.webp\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4660\" src=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/llvm.webp\" alt=\"llvm\" width=\"557\" height=\"206\" srcset=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/llvm.webp 557w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/llvm-300x111.webp 300w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/llvm-360x133.webp 360w\" sizes=\"(max-width: 557px) 100vw, 557px\"\/><\/a><\/figure>&#13;\n<\/div>\n\n\n\n<p>Here is the process in which the Swift compilers generate LLVM-IR (intermediate representation); LLVM also generates the ARM ELF file format used for the intermediate representation. Then the Android NDK, which allows for the use of native-code languages on Android, generates a binary linking against the generated object file. The file is packaged as an Android app.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Targeting_Android\"><\/span>Targeting Android<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The absence of SwiftCore library is the biggest hurdle in front of developers. Currently, Apple is working for the libraries for iOS, OS X and Watch OS but will they do it for Android version?<\/p>\n\n\n\n<p>Though SwiftCore library is not required for all the Swift code in a similar way like all C++ code requires the STL. So as long as we use the subset of Swift that doesn&#x2019;t hit SwiftCore. Let&#x2019;s take an example:<\/p>\n\n\n\n<p>\/\/ add.swiftfunc addTwoNumbers(first: UInt8, second: UInt8) -&gt; UInt8 {&nbsp; return first + second}<\/p>\n\n\n\n<p>So basically the process it going to be threefold:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ask the Swift compiler to generate some LLVM-IR<\/li>\n\n\n\n<li>Use LLVM to generate ARM ELF from the intermediate representation<\/li>\n\n\n\n<li>Use the Android NDK to generate a binary that links against the generated object file<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_We_Develop_Cross-Platform_Apps_with_SWIFT\"><\/span><span style=\"font-size: 16.5pt; line-height: 115%; font-family: 'Arial','sans-serif'; color: #787670;\">Can We Develop Cross-Platform Apps with SWIFT?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>&#13;\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development.webp\"><img decoding=\"async\" class=\"alignnone wp-image-4530 size-full\" src=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development.webp\" alt=\"android-app-development\" width=\"2100\" height=\"1200\" srcset=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development.webp 2100w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-300x171.webp 300w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-1024x585.webp 1024w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-768x439.webp 768w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-1536x878.webp 1536w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-2048x1170.webp 2048w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-360x206.webp 360w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-750x429.webp 750w\" sizes=\"(max-width: 2100px) 100vw, 2100px\"\/><\/a><\/p>\n\n\n\n\n\n<p><\/p><p><span style=\"font-family: 'Arial','sans-serif'; color: #7e7b76;\">Swift gives cutting edge advantage which is forcing developers to think whether they can use this programming language to write an app once for iOS and Android simultaneously.<\/span> <span style=\"font-family: 'Arial','sans-serif'; color: #7e7b76;\">We at <a href=\"https:\/\/www.sphinx-solution.com\">Sphinx Solutions<\/a> like to use a unified code-base to bring cross-platform apps for faster development. We are innovating to do the same with Swift, which will give us another great option for our customers.<\/span><\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/calendly.com\/sphinx-solutions\/30min\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignnone wp-image-4531 size-full\" src=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services.webp\" alt=\"android-app-development-services\" width=\"2280\" height=\"474\" srcset=\"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services.webp 2280w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-300x62.webp 300w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-1024x213.webp 1024w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-768x160.webp 768w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-1536x319.webp 1536w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-2048x426.webp 2048w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-360x75.webp 360w, https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/android-app-development-services-750x156.webp 750w\" sizes=\"(max-width: 2280px) 100vw, 2280px\"\/><\/a><\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We&#x2019;re excited about SWIFT. But it is under development stage, writing code for Android for a corporate application may be time-consuming and there are chances to compromise on various exciting features of Android. &#xA0;In the current scenario would you want to write apps for iOS and Android using Swift? Comment below or&#xA0;<a href=\"https:\/\/twitter.com\/sphinx_solution\">Tweet to us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is SWIFT? Swift is a new multi-paradigm programming language used to develop iOS, OS X, watchOS and further available for developing Android apps. It is considered as much safer&#x2026;\n<\/p>","protected":false},"author":1,"featured_media":8162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ub_ctt_via":"","footnotes":""},"categories":[1],"tags":[130,679,680,25,23],"class_list":{"0":"post-482","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technology","8":"tag-android-app-development","9":"tag-android-app-development-company","10":"tag-android-app-development-services","11":"tag-ios-programming-language","12":"tag-swift-ios"},"aioseo_notices":[],"featured_image_src":"https:\/\/www.sphinx-solution.com\/blog\/wp-content\/uploads\/2015\/10\/iphone-opensource-language.jpg","author_info":{"display_name":"Anand Mahajan","author_link":"https:\/\/www.sphinx-solution.com\/blog\/author\/sphinxuser\/"},"_links":{"self":[{"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":23,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"predecessor-version":[{"id":5871,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/posts\/482\/revisions\/5871"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/media\/8162"}],"wp:attachment":[{"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sphinx-solution.com\/blog\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}