android cookbook

本文解决 Android Studio 在 Windows 下无法启动的问题,并介绍了 match_parent 和 fill_parent 的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这篇博文将持续更新,主要是介绍一些android中的小知识点,就把它当做cookbook吧。

2 android studio 不能正常打开问题解决方法

       很多网友和我一样,当google I/O大会宣布了android studio开发工具,怀着好奇心和激情,迫不及待的在android developer上面下载了android studio,下载安装完成后却发现打不开。这里我估摸着各位网友和我一样用的是windows的产品,其实这是android studio安装文件的一个bug,解决方法是需要我们自己动手配置一下。网上很多网友也贡献了很多种方法,但是写得太难理解。下面我给大家介绍一种方法。

中文操作系统:

        打开开始菜单(左下角)>计算机>系统属性(左上角)>高级系统设置>高级
                在高级对话框的右下角选择环境变量>新建一个系统变量JAVA_HOME 变量值是你的计算机中安装的    
                JDK路径名,例如C:\Program Files\Java\jdk1.7.0_21
       好了,你重新点击android studio 图标就可以了。另外接下来我会写一系列关于这个工具开发android的文章,欢迎大家关注


1   match_parent and  fill_parent

     我们设置视图上面的组件时,经常要碰到这两个个设置点 fill_parent  ,wrap_content.到了android SDK2.2(API Level8)后新增了一个match_parent,很多网友都有点朦胧,因为fill_parent和match_parent的效果完全一样。下面我们来看看这段代码:

fill_parent          -1  The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent.  
match_parent   -1 The view should be as big as its parent (minus padding). Introduced in API Level 8.  
wrap_content   -2  The view should be only big enough to enclose its content (plus padding).  

这样我们可以清晰的看到fill_parent和wrap_content都定义为-1,很显然显示的效果就是一样的了。这样我们就姑且把match_parent当做fill_parent一个新的别名吧,或许android认为这样比较符合它的逻辑吧。

About This Book, See what Material design is about and how to apply it your apps, Explore the possibilities to develop apps that works on any type of device, A step-by-step practical guide that will help you build improved applications, change their look, and debug them, Who This Book Is For, This book is for developers that are already familiar with programming concepts and have already started creating apps for the Android platform, for example, by using the Eclipse IDE. It is for developers who intend to use Android Studio as their primary IDE or want to use Android Studio more efficiently., What You Will Learn, Develop Android Studio applications using Genymotion, Apply the concepts of Material design to your applications, Use memory monitoring tools to tweak performance, Build applications for Android Wearable, Capture images, video, or audio within your Android app, Use content providers to display data, Build apps with a cloud-based backend, Create media-related apps that will run on phones, phablets, tablets, and TVs, In Detail, This book starts with an introduction of Android Studio and why you should use this IDE rather than Eclipse. Moving ahead, it teaches you to build a simple app that requires no backend setup but uses Google Cloud or Parse instead. After that, you will learn how to create an Android app that can send and receive text and images using Google Cloud or Parse as a backend. It explains the concepts of Material design and how to apply them to an Android app. Also, it shows you how to build an app that runs on an Android wear device., Later, it explains how to build an app that takes advantage of the latest Android SDK while still supporting older Android versions. It also demonstrates how the performance of an app can be improved and how memory management tools that come with the Android Studio IDE can help you achieve this., By the end of the book, you will be able to develop high quality apps with a minimum amount of effort using the Android Studio IDE., Style and approach, This is a practical guide full of challenges and many real-world examples that demonstrate interesting development concepts. Besides smartphones and tablets, it also covers Android wearable devices and Android TV. Although strongly recommended, it is not necessary to own any Android device yourself.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值