離教者之家's Archiver

抽刀斷水 發表於 2018/4/11 22:01

傻佬學寫app

之前有人建議本網寫返個app,迎接人人用智能手機的潮流。雖然我並不認為本網造一個app可以有多少人用,衡量付出與收穫後看來不值得,但放下寫程式多年的我,也想試一下身手。

首先,之前已聽過iOS寫app的入場門檻很高,年費二、三千港元,因此我選擇Android,就算上不到Google Play,也可以自己抄apk來安裝。

這個網站似乎是比較正統的開始:
[url=https://developer.android.com/index.html]https://developer.android.com/index.html[/url]

那麼寫android app是用何種程式語言?

在[url=https://developer.android.com/guide/components/fundamentals.html]這裡[/url]說是用Java,但在[url=https://developer.android.com/kotlin/index.html]這裡[/url]卻說是Kotlin。我未聽過Kotlin,上網找找看,看來是頗新的程式語言:
[url=http://technews.tw/2017/05/19/kotlin-is-officially-supported-by-google-for-android-development/]http://technews.tw/2017/05/19/ko ... ndroid-development/[/url]

如果單是開發Android,學習Kotlin也是不錯的選擇,看來是簡單精煉的語言。但如果考慮將來在iOS也運行,就要看看它與iOS咬不咬弦。

[待續]

抽刀斷水 發表於 2018/4/11 22:13

看來Kotlin也希望支援iOS,也是剛開始:
[url=https://blog.kotlin-academy.com/multiplatform-native-development-in-kotlin-now-with-ios-a8546f436eec]https://blog.kotlin-academy.com/ ... th-ios-a8546f436eec[/url]

Kotlin/Native就是希望可以multi-platform target:[url=https://kotlinlang.org/docs/reference/native-overview.html]https://kotlinlang.org/docs/reference/native-overview.html[/url]

寫iOS App的語言是Swift或Objective-C,據[url=https://en.wikipedia.org/wiki/Swift_(programming_language)]這裡[/url]說,Swift像C,我應該不感到陌生。寫iOS App正統方式是要購買一部Mac安裝XCode,那麼我暫且唔理住,因我打算用$0投資學習。

在日新月異的科技,技術如行雲流水般出現又消失,我再看看Kotlin究竟是否值得投資時間去學習。

[待續]

抽刀斷水 發表於 2018/4/12 01:00

Apple 全力支持Swift,Google全力支持Kotlin,而且看來也準備吞併對方。

[url=https://dev.to/sciencesoft/kotlin-vs-swift-are-android-and-ios-moving-towards-creating-a-universal-language]這篇[/url]是從語言角度比較兩者。
[url=https://hackernoon.com/kotlin-and-swift-best-programming-languages-to-boost-developer-productivity-963ca8aec554]https://hackernoon.com/kotlin-an ... tivity-963ca8aec554[/url]

[待續]

blacktea 發表於 2018/4/12 11:07

全力支持抽刀斷水寫app!!

抽刀斷水 發表於 2018/4/12 14:16

多謝支持,我也未知能否成功。

現有由Swift轉成Kotlin的工具:
[url]https://github.com/angelolloqui/SwiftKotlin[/url]

也有由Kotlin轉為Swift的工具(但這是兩年前的作品):
[url]https://github.com/moshbit/Kotlift[/url]

而且也有Kotlin/Native可出iOS(只有arm64,即iPhone5s以上)。
[url]https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html[/url]

這裡說Kotlin可以行舊Android機:Kotlin is fully compatible with JDK 6, ensuring that Kotlin applications can run on older Android devices with no issues. The Kotlin tooling is fully supported in Android Studio and compatible with the Android build system.
[url]https://kotlinlang.org/docs/reference/android-overview.html[/url]

而且一開始我就以Android為首要目標,iOS就要看看將來怎樣。

那麼,就決定使用Kotlin吧:
[url]https://kotlinlang.org/[/url]

[待續]

blacktea 發表於 2018/4/12 18:13

希望將來有IOS版本,因為我是用APPLE手機的。不管怎樣,抽刀斷水都十分有心!:讚:

抽刀斷水 發表於 2018/4/12 21:01

哈,你真是懂得鼓勵人。:loveliness:

在開始之前,正路就是安裝[url=https://developer.android.com/studio/index.html]Android Studio[/url]。

經過多番下載,看到一大堆設定,不簡單的UI,看來也要先[url=https://developer.android.com/studio/intro/index.html]閱讀文件[/url],了解如何運用。

[待續]

抽刀斷水 發表於 2018/4/17 15:31

Android Studio應用典型的Model-view-controller architecture,官方教學都是簡單先教搞user interface,但我比較蠢,尤其是contraint layout,看來也比較新,以下這個比較詳細完整,我也打算先大概了解一下,然後邊寫邊學:

[url=https://inducesmile.com/android/android-constraintlayout-example-tutorial/]https://inducesmile.com/android/ ... t-example-tutorial/[/url]

後來翻看,原來官方教學也頗詳細,只是我未按入裡面看:
[url=https://developer.android.com/studio/write/layout-editor.html]https://developer.android.com/studio/write/layout-editor.html[/url]
[url=https://developer.android.com/training/constraint-layout/index.html]https://developer.android.com/training/constraint-layout/index.html[/url]

[待續]

抽刀斷水 發表於 2018/4/19 15:46

閱讀Build your first App,跟著做成功了,必須要做的備忘:

1. 做activity:即使用者介面,drag & drop Palette內的object,可用constraint layout,用constrained baseline對齊兩個components,如要因應螢幕大小作出彈性改變,就要兩個以上objects先create chain,再在擬彈性object的內長闊match constraints。object內的字不要hardcoded,要在res>values>strings.xml內define。

2. Pass text between activities:在parent activity coding 加sendMessage, 包括build intent,用putExtra傳送文字,當cannot resolve symbol時逐一按Alt-Enter來Import libraries。在child activity加intent.getStringExtra。再在AndriodManifest.xml的child activity加入其parent的名字,才會自動有navigation arrow。

[待續]

抽刀斷水 發表於 2018/4/26 21:49

4種components:
Activity - UI
Services - Background job
Broadcast Receivers - Receive system broadcast, create status bar, schedule job
Content providers - read / write data

Intent啟動activity - startActivity() 或 startActivityForResult(), 完結後可以有return value
Intent啟動 service - startService() / bindService() / JobScheduler() [ver 5.0 above [must explicit]
Intent啟動 broadcast receiver - sendBroadcast(), sendOrderedBroadcast(), 或 sendStickyBroadcast()
ContentResolver啟動content provider - query()

現在繼續看Core topics了。

[待續]

抽刀斷水 發表於 2021/4/12 11:48

因為某些原因研究暫停了,又因為某些原因又再開始看。

由於預計iOS同Android仍在短期內叮噹馬頭,不分高下,要投入學習兩套語言,對編程角度來說年邁的我尤其乏力。

連Google大神都看不過眼,於是創立了Flutter:
[url=https://flutter.dev/]https://flutter.dev/[/url]

從developer角度來說,我看跟著google是相對容易和有前途的,它半途而廢的東西不算多,而且程式碼向來精鍊快速,有相當口碑,只是這些程式碼估計仍持續更新得很快,還是要邊學邊寫再邊學新碼。

其他參考:
[url=https://www.appcoda.com.tw/flutter-basics/]https://www.appcoda.com.tw/flutter-basics/[/url]
[url=https://kknews.cc/zh-hk/code/5n2v283.html]https://kknews.cc/zh-hk/code/5n2v283.html[/url]
[url=https://hackernoon.com/one-year-with-flutter-my-experience-5bfe64acc96f]https://hackernoon.com/one-year- ... rience-5bfe64acc96f[/url]

負面意見:
[url=https://betterprogramming.pub/why-flutter-isnt-the-next-big-thing-e268488521f4]https://betterprogramming.pub/wh ... -thing-e268488521f4[/url]

上流寄生族 發表於 2021/4/12 15:07

[i=s] 本帖最後由 上流寄生族 於 2021/4/12 15:23 編輯 [/i]

[quote]因為某些原因研究暫停了,又因為某些原因又再開始看。

由於預計iOS同Android仍在短期內叮噹馬頭,不分高下 ...
[size=2][color=#999999]抽刀斷水 發表於 2021/4/12 11:48[/color] [url=https://exchristian.hk/forum/redirect.php?goto=findpost&pid=142573&ptid=13097][img]https://exchristian.hk/forum/images/common/back.gif[/img][/url][/size][/quote]全力[color=Red]不[/color]支持抽刀斷水兄分心太多!!

上流寄生族 發表於 2021/4/12 15:16

[i=s] 本帖最後由 上流寄生族 於 2021/4/12 15:19 編輯 [/i]

[quote]因為某些原因研究暫停了,又因為某些原因又再開始看。

由於預計iOS同Android仍在短期內叮噹馬頭,不分高下 ...
[size=2][color=#999999]抽刀斷水 發表於 2021/4/12 11:48[/color] [url=https://exchristian.hk/forum/redirect.php?goto=findpost&pid=142573&ptid=13097][img]https://exchristian.hk/forum/images/common/back.gif[/img][/url][/size][/quote]建议兄聚焦本业

只[color=Red]聚[/color]
才[color=Red]焦[/color]

德文;;;;;;;;;
um<it's around > ...... sonst【otherwise否则】
umsonst
[around otherwise ]
[徒劳无功]
[url=https://www.dict.cc/?s=sonst]https://www.dict.cc/?s=sonst[/url]

[url=https://www.dict.cc/?s=umsonst]https://www.dict.cc/?s=umsonst[/url]

上流寄生族 發表於 2021/4/12 15:26

[quote]因為某些原因研究暫停了,又因為某些原因又再開始看。

由於預計iOS同Android仍在短期內叮噹馬頭,不分高下 ...
[size=2][color=#999999]抽刀斷水 發表於 2021/4/12 11:48[/color] [url=https://exchristian.hk/forum/redirect.php?goto=findpost&pid=142573&ptid=13097][img]https://exchristian.hk/forum/images/common/back.gif[/img][/url][/size][/quote]建议兄pm余兄做什么公司让余看看有什么可帮谢谢兄

抽刀斷水 發表於 2021/4/12 20:50

工作跟這個沒有關係,只是想學多門手藝而已。
這門手藝應可充飢。

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.