1.å¼åå®åappç¨ä»ä¹è½¯ä»¶ï¼
2.要成为一名专业的源码程序员,从零开始需要怎么一步步来比较好,源码要把最底层的源码先学精通吗?(个人认为)求学长
3.å¦ä½å¨OpenWRTç¯å¢ä¸åå¼å
4.å¦ä½Pythonåä¸ä¸ªå®åAPP
å¼åå®åappç¨ä»ä¹è½¯ä»¶ï¼
androidç¨ä»ä¹è½¯ä»¶æ²ä»£ç ï¼
æ²ä»£ç ç¨ç软件æï¼Androidstudioï¼WebStormï¼IntellijIDEAï¼sourceinshghtï¼Vscodeã
1ãAndroidstudio
对UIçé¢è®¾è®¡åç¼å代ç ææ´å¥½å°æ¯æï¼å¯ä»¥æ¹ä¾¿å°è°æ´è®¾å¤ä¸çå¤ç§å辨çãåæ ·æ¯æProGuardå·¥å ·ååºç¨ç¾åãä¸è¿ï¼ç®åçæ¬çAndroidStudioä¸è½å¨åä¸çªå£ä¸ç®¡çå¤ä¸ªé¡¹ç®ã
2ãWebStorm
jetbrainså ¬å¸æä¸ä¸æ¬¾JavaScriptå¼åå·¥å ·ãç®åå·²ç»è¢«å¹¿å¤§ä¸å½JSå¼åè èªä¸ºâWebå端å¼åç¥å¨âãâæ强大çHTML5ç¼è¾å¨âãâææºè½çJavaScriptIDEâçãä¸IntelliJIDEAåæºï¼ç»§æ¿äºIntelliJIDEA强大çJSé¨åçåè½ãä¸è¿ï¼æçç²ä¸è¯´è¿ä¸ªæç¹å¡ï¼ä½æ¯åè½è¿æ¯é½å ¨çã
3ãIntellijIDEA
IntellijIDEAæ¯javaç¼ç¨è¯è¨å¼åçéæç¯å¢ï¼å¨ä¸çå ä¹è¢«å ¬è®¤æ¯æ¯è¾å¥½çä¸ä¸ªjavaå¼åå·¥å ·ã
4ãsourceinshght
ä¸ä¸ªé¢å项ç®å¼åçç¨åºç¼è¾å¨å代ç æµè§å¨ï¼å®æ¥æå ç½®ç对C/C++ï¼C#åJavaçç¨åºçåæãSourceInsightè½åæä½ çæºä»£ç 并å¨ä½ å·¥ä½çåæ¶å¨æç»´æ¤å®èªå·±ç符å·æ°æ®åºï¼å¹¶èªå¨ä¸ºä½ æ¾ç¤ºæç¨çä¸ä¸æä¿¡æ¯ãSourceInsightæä¾äºæå¿«éç对æºä»£ç ç导èªåä»»ä½ç¨åºç¼è¾å¨çæºä¿¡æ¯ã
5ãVscode
Vscodeå ¨ç§°VisualStudioCodeï¼æ¯ä¸æ¬¾é对äºç¼åç°ä»£webåäºåºç¨ç跨平å°æºä»£ç ç¼è¾å¨ã
ææºAPPå¼åå·¥å ·æåªäºå¿«éç¼å代ç
éç移å¨äºèç½çé£éåå±ï¼æºè½ææºçæ®ååï¼ææºappåºç¨è½¯ä»¶å·²ç»æ为äºäººä»¬çæ´»ä¸çä¸é¨åï¼APPå¼åè¡ä¸ä¹ç±è¿å»çèæµ·åæ红海äºã
èapp软件å¼åçæçå·²ç»æ为äºç®åå¼åè¡ä¸çå ³é®ï¼å¦ä½æè½å¿«éæåapp软件å¼åæçï¼è¿æ¯æ¯ä¸ä½app软件å¼åå·¥ç¨å¸æä¸ºå ³å¿çé®é¢äºï¼é£ä¹å¦ä½æè½æå软件çå¼åæçå¢ï¼è¿å½ç¶ç¦»ä¸å¼ä¸æ¬¾å¥½çapp软件å¼åå·¥å ·äºã
ä¸é¢å°±ä¸ºå¤§å®¶ä»ç»å 款ç®åAPPå®å¶å¼åå¸åºç主æµå¼åå·¥å ·ã
é¦å ï¼APPå¼åå æ¬å 个平å°ï¼IOSå¼åãAndroidå¼åãwindowså¼åï¼IPadå¼åçï¼ä¸åçå¹³å°åºç¨è½¯ä»¶å¼åæä¸åçappå¼åå·¥å ·ã
BiznessApps软件å¼åå·¥å ·ï¼
BiznessApps软件å¼åå·¥å ·
è¿æ¯ä¸åä¸é¨ä¸ºä¸å°ä¼ä¸æä¾çä¸ä¸ªå¿«éå¶ä½ææºAPPåºç¨è½¯ä»¶çå¹³å°ã
å®ç®åæ¯æçå¼åå¹³å°æIOSï¼å«iPhoneåIPadï¼ãAndroidè¿ä¸¤ï¼å¼åè å¯ä»¥ç´æ¥å¨è¿ä¸ªå¹³å°ä¸å¶ä½IOSåå®åçappåºç¨ã
è¿æ¯ä¸æ¬¾å¯è§åçæä½è½¯ä»¶ï¼ç¨æ·å®å ¨ä¸éè¦ä¸¾æ¥ä»»ä½çç¼ç¨ç¥è¯ï¼åªéè¦å¨å¹³å°ä¸å¾éåææ½å°±å¯ä»¥äºï¼ç®åææä½ã
BiznessApps为åç§ç±»åçappæä¾ç¸åºç模çï¼ä»¥åå个模çç¸åºç常è§åè½ï¼å¼åè åªéè¦è¿ä¸æ¥å¾éèªå·±éè¦çåè½å°±å¯ä»¥å®ææ´ä¸ªçapp设计ã
APPMakr软件å¼åå·¥å ·ï¼
APPMakr软件å¼åå·¥å ·
è¿ä¹æ¯ä¸æ¬¾å¯è§åçå¼åå·¥å ·ï¼ä¸»è¦ç对象è¿æ¯é对ä¸ä¼ç¼ç¨çç¨æ·æä¾çä¸ä¸ªåè½é½å ¨çææºAPP客æ·ç«¯è½¯ä»¶å¼åå¹³å°ï¼éé¢å¸¦æåè½é½å ¨çDIYå·¥å ·å ï¼ç¨æ·å¯ä»¥æ ¹æ®èªå·±çéæ±DIY设计èªå·±éè¦çAPP软件ã
ç®åAppMakrå·¥å ·å¤§é¨åæ¯é对IOSç³»ç»å¼åçã
Appsgeyser软件å¼åå·¥å ·ï¼
Appsgeyser软件å¼åå·¥å ·
使ç¨AppsGeyserå°±å¯ä»¥è®©ä»»ä½äººé½å¯ä»¥ååºç¨ç¨åºçå¼åã
å½ç¶ï¼è¿ä¸ªç¨åºå¹¶ä¸è½è®©ä½ å建ä¸ä¸ä¸ªæ¤æçå°é¸æè Foursquareã
MobileRoadieAPPå¼åå·¥å ·ï¼
MobileRoadieAPPå¼åå·¥å ·
è¿æ¯ä¸æ¬¾ç®åå½å¤æ¯è¾æµè¡çapp软件å¼åå·¥å ·ï¼MobileRoadieå·¥å ·æ´åäºæ´åYouTube,Brightcove,Flickr,Twitpic,Ustream,Topspin,Googleèµè®¯ï¼RSS,TwitteråFacebookã
ç¨æ·å¯ä½¿ç¨è¯¥åºç¨å¹³å°å¼åiOSåAndroidçåºç¨ï¼å¹¶å¯ä»¥ä½¿ç¨å ¶æä¾çå 容管çç³»ç»æ´æ°èµè®¯ï¼ä¹å¯èªè¡ä¿®æ¹åºç¨ç»èã
MobileRoadieè¿æä¾äºæ°æ®åæå·¥å ·ã
DevmyAppå¼åå·¥å ·ï¼
DevmyAppå¼åå·¥å ·
è¿æ¯ä¸æ¬¾æ¯è¾å»çå¼çiOSææºå®¢æ·ç«¯å¼åå·¥å ·ï¼è¿æ¬¾å·¥å ·ä¸»è¦é对çæ¯IOSç³»ç»çå¼åã
æäºè¯¥è½¯ä»¶ï¼å¼åè å°±å¯ä»¥èªç±çå建ã设计åå¼åèªå·±çiOSåºç¨ç¨åºäºï¼åæ¶è¿å¯é¿å 为ä¸äºç»å¸¸åºç°çåè½æ¨¡åéå¤ç¼å代ç ï¼è¿æ¬¾ç¨åºæ¯è¾éåè¹æææºå®¢æ·ç«¯è½¯ä»¶çå¶ä½å¼å
æ»ç»ï¼ä»¥ä¸è¿äºæ¬¾ææºappå¼åå·¥å ·æ¯ç®åå¸åºä¸ä¸»æµçappå¼åå·¥å ·ï¼ä¸è¿æ¯æç¼ç¨è¿æ¯ä¸æåæé½é常çéåï¼ä¸æ¬¾å¥½çapp软件å¼åå·¥å ·å¯ä»¥å¤§å¤§çæåå¼å人åçå¼åæçã
å®åç游æå¶ä½ç¨ä»ä¹è½¯ä»¶ï¼é¦å è¦ä¼è®¡ç®æºè¯è¨ï¼æ¯å¦Javaç¼ç¨è¯è¨å°±å¯ä»¥å¼åå®å游æã
è¿ä¼è®¾è®¡æ¸¸æå¼æï¼æ¯å¦AndEngineçå¼æºæ¸¸æå¼æåBox2Dç©çå¼æçã
è¿æ软件å¼åå·¥å ·ï¼æ¯å¦Android软件å¼åå·¥å ·å AndroidSDKã
å¦å¤å¾åå·¥å ·ï¼æ¸¸æ离ä¸å¼å¤§éçå¾åAdobeIllustratoræå ¶ä»ä¸ä¸å·¥å ·ã
æ©å±èµæï¼
å®åAPKå¼åç¯å¢
Androidæ¯ä¸ä¸ªåºäºJavaçå¼åç¯å¢ï¼Googleä¹å¨APIææ¡£ç书ååæ ·ä¾çæä¾ä¸åäºå¾åºè²çå·¥ä½ã
ä¸è½½å¹¶å®è£ androidçSDK[软件å¼åå¥ä»¶]ï¼è¿å¥SDK主è¦å æ¬ææ ¸å¿åºæ件ï¼ä¸ä¸ªæ¨¡æå¨ï¼å¼åå·¥å ·åä¸äºç¤ºèçæ ·ä¾æ件ãæ¨è使ç¨Eclipseåandroideclipseæ©å±ã
å¦æåªæ¯ä½¿ç¨androidï¼EclipseIDE就已ç»è¶³å¤äºï¼ä½å¦ææ¯ç¬¬ä¸æ¬¡å¼åJavaåºç¨ï¼ä¸è½½å®æ´çJavaSEå¼åå·¥å ·(JDK)å®å æ¬ç¾ååºç¨ç¨åºæéè¦çå·¥å ·ã
åèèµææ¥æºï¼ç¾åº¦ç¾ç§-apk
åå®å软件å¼åéè¦åªäºå·¥å ·ï¼androidæ¯åºäºlinuxçï¼æ以å¨ubuntuä¸æ¯æ好çãå½ç¶windowsä¸é¢ä¹æ¯å¯ä»¥çãä½æ¯androidçå æ ¸æ¯åºäºlinuxçï¼å¹¶ä¸éè¿ç»ç«¯è¿è¡åç§æä½ï¼é常强大ï¼ä¹æ¯cmdæ¹ä¾¿ã
大è´å¼åçç¯å¢æ¯è¿æ ·ï¼ubuntuç³»ç»ï¼ä»¥åæ¯windowsç¶åå®è£ äºubuntuçèææºãandroid大é¨åçå¼åé½æ¯ä¸é´å±å°é¡¶å±çåºç¨å¼åï¼æ以åºæ¬ä¸æ¯javaå¼åã
表é å¦ä¸ï¼1eclipseæ¯å¼åjavaå¿ å¤ï¼ä¹æ¯androidå¿ å¤ãï¼å½ç¶åææ¯å å®è£ JDK1.6ï¼
2ä¸è½½androidçSDKåADTãè¿æ¯androidçå¼åå¿ é¡»çå·¥å ·ï¼adbãddmsãmksdcardãaaptï¼debugå¿ å¤
Aå®è£ å®eclipseåï¼éè¿help=ãinstallnewsoftwareæADTå®è£ 好
Bç¶åwindow=preference设置好SDKçè·¯å¾å³å¯
å¦æç¨å°Cå¼åçè¯ï¼å¯ä»¥å®è£ ä¸ä¸CDT
ç°å¨å¯ä»¥éè¿AVDmanagerå®è£ ä¸ä¸èªå·±æ³å¨åªä¸ªå¹³å°ä¸çapiï¼æ¯å¦ï¼android2.3.4ï¼å°±å¯ä»¥å»ºä¸ä¸ª2.3.4çemulatorï¼æ模æå¨è·èµ·æ¥ãéè¿adbddmsçå·¥å ·å¯çãå¼åäºã为äºæ¹ä¾¿ï¼æadbçè·¯å¾å å°ç¯å¢åééã
设计ä¸ä¸ªappï¼éè¦ç¨å°åªäºè½¯ä»¶ï¼appæ两个éµè¥ï¼ä¸ç¥éé¢ä¸»è¯´çå®åéµè¥çè¿æ¯è¹æéµè¥ï¼ä¸é¢ä¸¤ä¸ªé½è¯´ä¸ä¸å§ï¼
å®åappå¼åå·¥å ·å¯ä»¥ç¨å®åèªå·±å®¶æ¨åºçAndroidstudioæè eclipesççã
è¹æappçå¼åå·¥å ·å¯ä»¥ä½¿ç¨coderunnerï¼appcodeæè chocalatççã
欲åå ¶åï¼å¿ å å©å ¶å¨ï¼éæ©ä¸æ¬¾å¥½çå¼åå·¥å ·å¯ä»¥å¸®å©ä½ æ´å¿«çæ·±å ¥äºè§£ï¼
要成为一名专业的程序员,从零开始需要怎么一步步来比较好,源码要把最底层的源码先学精通吗?(个人认为)求学长
前言
你是否觉得自己从学校毕业的时候只做过小玩具一样的程序?走入职场后哪怕没有什么经验也可以把以下这些课外练习走一遍(朋友的抱怨:学校课程总是从理论出发,作业项目都看不出有什么实际作用,源码机房环境监控 源码不如从工作中的源码需求出发)
建议:
不要乱买书,不要乱追新技术新名词,源码基础的源码东西经过很长时间积累而且还会在未来至少年通用。
回顾一下历史,源码看看历史上时间线上技术的源码发展,你才能明白明天会是源码什么样。
一定要动手,源码例子不管多么简单,源码建议至少自己手敲一遍看看是源码否理解了里头的细枝末节。
一定要学会思考,思考为什么要这样,而不是那样。还要举一反三地思考。小小帝国源码
注:你也许会很奇怪为什么下面的东西很偏Unix/Linux,这是因为我觉得Windows下的编程可能会在未来很没有前途,原因如下:
现在的用户界面几乎被两个东西主宰了,1)Web,2)移动设备iOS或Android。Windows的图形界面不吃香了。
越来越多的企业在用成本低性能高的Linux和各种开源技术来构架其系统,Windows的成本太高了。
微软的im 源码 github东西变得太快了,很不持久,他们完全是在玩弄程序员。详情参见《Windows编程革命史》
所以,我个人认为以后的趋势是前端是Web+移动,后端是Linux+开源。开发这边基本上没Windows什么事。
启蒙入门
1、 学习一门脚本语言,例如Python/Ruby
可以让你摆脱对底层语言的源码转换在线恐惧感,脚本语言可以让你很快开发出能用得上的小程序。实践项目:
处理文本文件,或者csv (关键词 python csv, python open, python sys) 读一个本地文件,逐行处理(例如 word count,或者处理log)
遍历本地文件系统 (sys, os, path),例如写一个程序统计一个目录下所有文件大小并按各种条件排序并保存结果
跟数据库打交道 (python sqlite),写一个小脚本统计数据库里条目数量
学会用各种print之类简单粗暴的方式进行调试
学会用Google (phrase, domain, use reader to follow tech blogs)
为什么要学脚本语言,因为他们实在是太方便了,很多时候我们需要写点小工具或是字体特效 源码脚本来帮我们解决问题,你就会发现正规的编程语言太难用了。
2、 用熟一种程序员的编辑器(不是IDE) 和一些基本工具
Vim / Emacs / Notepad++,学会如何配置代码补全,外观,外部命令等。
Source Insight (或 ctag)
使用这些东西不是为了Cool,而是这些编辑器在查看、修改代码/配置文章/日志会更快更有效率。
3、 熟悉Unix/Linux Shell和常见的命令行
如果你用windows,至少学会用虚拟机里的linux, vmware player是免费的,装个Ubuntu吧
一定要少用少用图形界面。
学会使用man来查看帮助
文件系统结构和基本操作 ls/chmod/chown/rm/find/ln/cat/mount/mkdir/tar/gzip …
学会使用一些文本操作命令 sed/awk/grep/tail/less/more …
学会使用一些管理命令 ps/top/lsof/netstat/kill/tcpdump/iptables/dd…
了解/etc目录下的各种配置文章,学会查看/var/log下的系统日志,以及/proc下的系统运行信息
了解正则表达式,使用正则表达式来查找文件。
对于程序员来说Unix/Linux比Windows简单多了。(参看我四年前CSDN的博文《其实Unix很简单》)学会使用Unix/Linux你会发现图形界面在某些时候实在是太难用了,相当地相当地降低工作效率。
4、 学习Web基础(HTML/CSS/JS) + 服务器端技术 (LAMP)
未来必然是Web的世界,学习WEB基础的最佳网站是W3School。
学习HTML基本语法
学习CSS如何选中HTML元素并应用一些基本样式(关键词:box model)
学会用 Firefox + Firebug 或 chrome 查看你觉得很炫的网页结构,并动态修改。
学习使用Javascript操纵HTML元件。理解DOM和动态网页(Dynamic HTML: The Definitive Reference, 3rd Edition - O'Reilly Media) 网上有免费的章节,足够用了。或参看 DOM 。
学会用 Firefox + Firebug 或 chrome 调试Javascript代码(设置断点,查看变量,性能,控制台等)
在一台机器上配置Apache 或 Nginx
学习PHP,让后台PHP和前台HTML进行数据交互,对服务器相应浏览器请求形成初步认识。实现一个表单提交和反显的功能。
把PHP连接本地或者远程数据库 MySQL(MySQL 和 SQL现学现用够了)
跟完一个名校的网络编程课程(例如:pile?\n\n");
return 0;
}
ããç¼åMakefileæ件
# build helloworld executable when user executes "make"
ããhelloworld: helloworld.o
$(CC) $(LDFLAGS) helloworld.o -o helloworld
ããhelloworld.o: helloworld.c
$(CC) $(CFLAGS) -c helloworld.c
ãã# remove object files and executable when user executes "make clean"
clean:
rm *.o helloworld
å¨è¿ä¸¤ä¸ªæ件çç®å½ä¸ï¼æ§è¡make åºè¯¥å¯ä»¥çæhelloworldçå¯æ§è¡æ件ãæ§è¡helloworldåï¼è½å¤æå°åºâHell! O' world, why won't my code compile?âã è¿ä¸æ¥ï¼ä¸»è¦ä¿è¯æ们çæºç¨åºæ¯å¯ä»¥æ£å¸¸ç¼è¯çãä¸é¢æ们å°å ¶ç§»æ¤å°OpenWRTä¸ã
ããï¼2ï¼å°OpenWrt-SDK-brcmxx-for-Linux-x_-gcc-4.3.3+cs_uClibc-0.9..1.tar.bz2解å
tar âxvf OpenWrt-SDK-brcmxx-for-Linux-x_-gcc-4.3.3+cs_uClibc-0.9..1.tar.bz2
ããï¼3ï¼è¿å ¥SDK
cd OpenWrt-SDK-brcmxx-for-Linux-x_-gcc-4.3.3+cs_uClibc-0.9..1
å¯ä»¥çå°éé¢çç®å½ç»æè·æ们ä¹åsourceçç®å½ç»æåºæ¬ç¸åï¼æéè¦ç¼è¯ç软件å ï¼éè¦æ¾ç½®å¨packageç®å½ä¸
ããï¼4ï¼å¨packageç®å½ä¸å建helloworldç®å½
cd package
mkdir helloworld
cd helloworld
ããï¼5ï¼å建srcç®å½ï¼æ·è´ helloworldæ件
mkdir src
cp /home/wrt/test/helloworld.c src
cp /home/wrt/test/Makefile src
ããï¼6ï¼å¨helloworldç®å½ä¸å建Makefileæ件
è¿ä¸ªMakefileæ件æ¯ç»OpenWRT读çï¼èä¹ååçé£ä¸ªMakefileæ件æ¯é对helloworldç»ç¼è¯å ¶è¯»çã两个Makefileä¸å¨åä¸å±ç®å½ä¸ã
ããtouch Makefile
vim Makefile
ããMakefileæ件模æ¿å 容å¦ä¸ï¼
##############################################
# OpenWrt Makefile for helloworld program
#
#
# Most of the variables used here are defined in
# the include directives below. We just need to
# specify a basic description of the package,
# where to build our program, where to find
# the source files, and where to install the
# compiled program on the router.
#
# Be very careful of spacing in this file.
# Indents should be tabs, not spaces, and
# there should be no trailing whitespace in
# lines that are not commented.
#
##############################################
ããinclude $(TOPDIR)/rules.mk
ãã# Name and release number of this package
PKG_NAME:=helloworld
PKG_RELEASE:=1
ãã# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
ããinclude $(INCLUDE_DIR)/package.mk
ãã# Specify package information for this program.
# The variables defined here should be self explanatory.
# If you are running Kamikaze, delete the DESCRIPTION
# variable below and uncomment the Kamikaze define
# directive for the description below
define Package/helloworld
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Helloworld -- prints a snarky message
endef
ãã# Uncomment portion below for Kamikaze and delete DESCRIPTION variable above
define Package/helloworld/description
If you can't figure out what this program does, you're probably
brain-dead and need immediate medical attention.
endef
ãã# Specify what needs to be done to prepare for building the package.
# In our case, we need to copy the source files to the build directory.
# This is NOT the default. The default uses the PKG_SOURCE_URL and the
# PKG_SOURCE which is not defined here to download the source from the web.
# In order to just build a simple program that we have just written, it is
# much easier to do it this way.
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
ãã# We do not need to define Build/Configure or Build/Compile directives
# The defaults are appropriate for compiling a simple program such as this one
ãã# Specify where and how to install the program. Since we only have one file,
# the helloworld executable, install it by copying it to the /bin directory on
# the router. The $(1) variable represents the root directory on the router running
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
# directory if it does not already exist. Likewise $(INSTALL_BIN) contains the
# command to copy the binary file from its current location (in our case the build
# directory) to the install directory.
define Package/helloworld/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/bin/
endef
ãã# This line executes the necessary commands to compile our program.
# The above define directives specify all the information needed, but this
# line calls BuildPackage which in turn actually uses this information to
# build a package.
$(eval $(call BuildPackage,helloworld))
ããï¼7ï¼è¿åå°SDKçæ ¹ç®å½
æ§è¡makeè¿è¡ç¼è¯
ç¼è¯è¿ç¨ä¼å¨build_dirç®å½ä¸å®æ
ç¼è¯ç»æä¼æ¾å¨ bin/[yourtarget]/packageç®å½ä¸helloworld_1_bcmxx.ipk
ããï¼8ï¼ä¸ä¼ helloworld_1_bcmxx.ipk
使ç¨sftp软件ä¸ä¼ helloworld_1_bcmxx.ipkè³è·¯ç±å¨
æ§è¡ opkg install helloworld_1_bcmxx.ipk
è¾å ¥helloç¶åæTabé®ï¼åç°openwrtä¸å·²ç»æhelloworldå¯æ§è¡å½ä»¤ã
æ§è¡ helloworld æ¥çç¨åºçææã
ããHell! O' world, why won't my code compile?
ãããEndã
ããå¸æ对大家è½æå¸®å© :)
å¦ä½Pythonåä¸ä¸ªå®åAPP
åè¨ï¼ç¨Pythonåå®åAPPè¯å®ä¸æ¯æ好çéæ©ï¼ä½æ¯è¯å®æ¯ä¸ä¸ªå¾å·æçéæ©ï¼èä¸å®å¨ä¸æ³å¦ä¹ Javaï¼åè ï¼å°±ç¼ç¨èè¨å·²ç»ä¼çå°±Pythonä¸Golang(注ï¼Pythonï¼Golangæ°´å¹³é½ä¸è¬)ï¼é£ä¹ä¹ Googleäºä¸ä¸Pythonåå®åçAPPçå¯è½æ§ï¼è¿çè¡ãæ¢ç¶è¦å个APPï¼é£ä¹æ»å¾è¦æ个æ³æ³å§ã
å ¶å®ç¬è æ³å两个APPæ¥çï¼ä¸ä¸ªæ¯èªå·±åç好ç©çï¼ä¸ä¸ªæ¯å ³äºè¿ç»´çã
å ³äºè¿ç»´çAPPï¼è®¾è®¡åºè¯¥å¦ä¸
å¯è½é¿è¿æ ·ï¼
ç¶å设计åºè¯¥æ¯è¿æ ·ï¼
å¦æè§å¾å¯è¡çè¯ï¼è¯è®ºçè¨ä¸ä¸ä½ è§å¾åºè¯¥åè¿è¿ä¸ªAPPçè¿ç»´å¸¸ç¨å½ä»¤å§^_^ï¼ç¬è ææ¶æ³å°çæ¯top,free -m,df âh,uptime,iftop,iotop,å¦ææä»ä¹å¥½çæ³æ³å°±ç ç çç ¸è¿æ¥å§ï¼ç¬è å°æ¶åºè¯¥ä¹ä¼æè¿ä¸ªåæä¸ä¸ªé¡¹ç®æ¾å°githubä¸ï¼å¤§å®¶ä¸èµ·ç¨åï¼å¼æºææ¯çéï¼ååã
好å§ï¼è¿å ¥æ£é¢ã
æ们使ç¨kivyå¼åå®åAPPï¼Kivyæ¯ä¸å¥ä¸é¨ç¨äºè·¨å¹³å°å¿«éåºç¨å¼åçå¼æºæ¡æ¶ï¼ä½¿ç¨PythonåCythonç¼åï¼å¯¹äºå¤ç¹è§¦æ§æçé常è¯å¥½çæ¯æï¼ä¸ä» è½è®©å¼åè å¿«éå®æç®æ´ç交äºåå设计ï¼è¿æ¯æ代ç éç¨åé¨ç½²ï¼ç»å¯¹æ¯ä¸æ¬¾é¢è®©äººæè³çNUIæ¡æ¶ã
å 为跨平å°çï¼æ以åªåä¸é代ç ï¼å°±å¯ä»¥åæ¶çæå®ååIOSçAPPï¼å¾é ·å§ã
æ¬æä¼å¸¦å¤§å®¶åä¸ä¸ªHello world并ç§ä¸ç§Pythonççç代ç
kivyå®è£
ç¯å¢è¯´æï¼ç¬è å¨ç¨çæ¯Python2.7.
è¿éä» ä»ç»windowså¹³å°å®è£
æ´æ°pip,setuptools
python -m pip install --upgrade pip wheel setuptools
ç¶åæ¯å®è£ æéè¦çä¾èµ
python -m pip install docutils pygmentspypiwin kivy.deps.sdl2 kivy.deps.glew \
kivy.deps.gstreamer --extra-index-url ple/
å¼å¾æ³¨æçæ¯ï¼ä¸é¢çå®åéè¦è®¿é®Googleï¼æ以请èªå¤æ¢¯åï¼èä¸kivy.deps.gstreamerè¿ä¸ªå æ¯è¾å¤§(MB)ï¼å¯ä»¥åç¬æ¬å°å®è£ ï¼h
ç¶åå°±æ¯å®è£ kivyäº
python -m pip install kivy
è³æ¤ï¼å®è£ 就已ç»å®æ¯äºï¼å¼å¾æ³¨æçæ¯ä½ç³»ç»æ²¡æå¼å¯èæåæ¯æï¼å¨å¯¼å ¥kivyçæ¶åä¼æ¥éï¼å¦ææ¯ä½ç³»ç»å°±è®¾ç½®ä¸ä¸æºå¨çBIOSï¼å¼å¯èæåæ¯æå§ã
注ï¼è¿éåªæ¯kivyçè¿è¡ç¯å¢ï¼è¿æ ·æå°±è½ç´æ¥å¨windowsæºå¨ä¸ç´æ¥è°è¯äºï¼æä¹å°ä»£ç ç¼è¯æAPKæ件æ们ä¼å¨åé¢è®²å°ã
å¦ækivyå¨pythonä¸åºè¯¥å°±è½å¯¼å ¥äºã
æç §ä¸çæ¯ä¾ï¼æ们âhelloâä¸ä¸å§ã
æ°å»ºä¸ä¸ª.pyæ件
from kivy.app import App
from kivy.uix.button importButton
class TestApp(App):
def build(self):
return Button(text='Hello,kivy')
TestApp().run()
è¿è¡ï¼
ç¶åä¼å¼¹åºä¸ä¸ªæ¡ï¼å¤§æ¦å¦ä¸ï¼ç¹å»âhello,kivyâä¼åé¢è²
ç¹å»çªå£å¹¶æâF1âä¼è¿ä¸ªçªå£çä¸äºå±æ§
ç¶åæ们åè¿å¤´çä¸ç代ç ã
##å¯¼å ¥Appï¼ç¶å让TestAppè¿ä¸ªç±»ç»§æ¿
from kivy.app import App
##å¯¼å ¥ä¸ä¸ªButton,è¿ç»´æè¿ä¸ªbuttonï¼å½ä½ ç¹å»çæ¶åæä¼ææååº
from kivy.uix.button importButton
###å®ä¹ç±»ï¼ååå¿ é¡»æ¯xxxApp
class TestApp(App):
###buildä¸ä¸ªButton
def build(self):
###è¿åä¸ä¸ªButton,æåå 容æ¯âHello,kivyâ
return Button(text='Hello,kivy')
##è¿è¡,å 为继æ¿äºAppï¼æ以ææçrunè¿ä¸ªæ¹æ³
TestApp().run()
ä¸é¢å°±æ¯æ们çHelloäº
å¨windowsä¸è¿è¡å½ç¶æ²¡æä»ä¹å¤ªå¤§çæä¹ï¼æä¹å¨å®åææºä¸è¿è¡ææ¯æ们æ³è¦çï¼
è¿æ¶æ们éè¦ä¸ä¸ªç¼è¯ç¯å¢ã
å®æ¹è¯´æçç¯å¢ï¼å¦ä¸ï¼
Youâll need:
A linux computer or a virtual machine
Java
Python 2.7 (not 2.6.)
Jinja2 (python module)
Apache ant
Android SDK
è½ç¶å®æ¹æä¾äºä¸ä¸ªä¼¼ä¹è¿ä¸éçèææºéåï¼ä½æ¯è¿æ¯æå¾å¤å 容éè¦ç¿»åºå»ï¼æ以ç¬è å¨
å½ç¶ä½ ä¹å¯ä»¥ä¸è½½å®æ¹éåï¼å 为第ä¸æ¬¡ç¼è¯éè¦å»å½å¤ä¸ä¸å¤§å ä¸è¥¿ï¼æ以请èªå¤æ¢¯åã
Virtual Machine
A Virtual Machine with Android SDK and NDK and all otherpre-requisites pre installed to ease apk generation:
Kivy Buildozer VM
Or select the Torrent
å¨ç¬è æä¾çéåéï¼æ¡é¢ä¸æä¸ä¸ªdev_andï¼åªè¦å°ä¸é¢åç代ç ï¼æ¾å ¥è¿ä¸ªæ件夹å³å¯(å½ç¶ä¹å¯ä»¥å¨å ¶ä»ç®å½ï¼åé¢ä¼è®²å°)ã
cd Desktop/dev_and/
åå§åä¼å¨å½åç®å½çæä¸ä¸ªbuildozer.specæ件 ç¨äºé ç½®çæçapkç¸å ³ä¿¡æ¯
buildozer init
ä¿®æ¹buildozer.specæ件
vi buildozer.spec
è³å°ä¿®æ¹ä¸é¢ä¸é¡¹
# (str) Title of your application
title = helloworld
# (str) Package name
package.name = helloapp
# (str) Package domain (needed for android/ios packaging)
package.domain = youer.com
ç¶å注é
# (str) Application versioning (method 1)
#version.regex = __version__ = ['"](.*)['"]
#version.filename = %(source.dir)s/main.py
ä¸é¢è¿è¡æ¹ä¸ºé注é
version = 1.2.
æåæ们çææ们éè¦çapkæ件
buildozer -v android debug
buildozerå½ä»¤ä¼å¨å½åæ件夹å建ä¸ä¸ªbinï¼è¯¥æ件夹éé¢ææ们æ³è¦çapkæ件
helloapp-1.2.0-debug.apk
å®è£ 以ååºè¯¥æ¯è¿æ ·
è¯è¯´å¨ç¼è¯çæ¶åå¯è½åºç°ç©ºé´ä¸è¶³çæ åµï¼æ ¹æ®èææºçä¸å(vmwareævirtualbox)èªè¡æ©å®¹å§ã
æåæ们æ¥ç§ç§ç®æçPythonå¼åçè¿ä¸ªæ¸¸æçæºä»£ç ã
å çææå¾
è¯ç©äºä¸ä¸ï¼è¿æ¯è®æµç çï¼æå ´è¶£çå¯ä»¥ä¸è½½ç©ä¸ä¸
è¿ä¸ªæ¸¸æ代ç è½ç¶ä¸é¿ï¼ä½æ¯è¿æ¯è®å ç¯å¹ çï¼æ以ç®è¦ç说æä¸ä¸æµç¨ï¼
主è¦ç±ä¸é¨åç»æï¼ä¸æ¯ç´ æï¼å¾çé³é¢ä¹ç±»çæ件ï¼äºæ¯Python代ç ï¼ä¸æ¯kvæ件ï¼è¿ä¸ªkvæ件æç¹åhtmlä¸çcssã
Python代ç çæ件åä¸è¬å½å为main.py
ç¶åä¸å®æä¸ä¸ªå«åXXXAppçç±»ï¼å¹¶ç»§æ¿Appã
æ¯å¦è¯¥ç±»å«åGameAppï¼é£ä¹è¯¥ç®å½ä¸çkvæ件åå¿ é¡»ä¸ºGameï¼å¦ä¸å¾æ示ï¼å¦æä¸æ¯ï¼é£ä¹kvæ件ä¸çä¸äºè®¾å®å°±ä¸ä¼çæã
æ¯å¦è®¾å®ä¸ä¸ªæ ç¾
Label:
id: time
text: 'xxxx'
font_size:
id为timeï¼textææ¬å 容为âxxxxâ,ç¶ååä½ä¸º
好å§ï¼ç¹å°ä¸ºæ¢å§ï¼ä¸è¿ä¼¼ä¹ä»ä¹é½æ²¡ç¹å°~~~
ä»æ å°æåä¸ä¸ªAppï¼ææ³æä¼å¦èµ·ä¸ç¯æç« å§ã