当前位置:  编程技术>移动开发
本页文章导读:
    ▪Titanium获2012年MWC绝佳云技术        Titanium获2012年MWC最佳云技术 全球移动通信系统协会(GSMA)在巴塞罗那举办的移动通信世界大会(MWC)上宣布了第17届年度全球移动大奖的得主。 各个奖项得主分别是:http://www.globalmobileawards.com/winn.........
    ▪ Toast控件的运用        Toast控件的应用 一、Toast自定义显示位置效果   Toast toast = Toast.makeText(getApplicationContext(), "自定义位置Toast", Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); toast.show();     二、Toast带图.........
    ▪ ndk编译so的几个小问题       ndk编译so的几个问题 开始用ndk编译so,出了几个问题,先整理一下。希望以后遇到的人能省些力气。   1. dr@drBox:~/workspace/JniTest/jni$ ~/android-ndk-r6/ndk-build Compile++ thumb : Test <= JniTest.cpp /bin/sh: .........

[1]Titanium获2012年MWC绝佳云技术
    来源: 互联网  发布时间: 2014-02-18
Titanium获2012年MWC最佳云技术
全球移动通信系统协会(GSMA)在巴塞罗那举办的移动通信世界大会(MWC)上宣布了第17届年度全球移动大奖的得主。 各个奖项得主分别是:
http://www.globalmobileawards.com/winners2012.php

其中Appcelerator - Titanium综合开发平台(Titanium Integrated Development Platform)获得最佳云技术!

    
[2] Toast控件的运用
    来源: 互联网  发布时间: 2014-02-18
Toast控件的应用

一、Toast自定义显示位置效果

 

Toast toast = Toast.makeText(getApplicationContext(),
     "自定义位置Toast", Toast.LENGTH_LONG);
   toast.setGravity(Gravity.CENTER, 0, 0);
   toast.show();

 


 

二、Toast带图片

 

Toast toast = Toast.makeText(getApplicationContext(),"带图片的Toast", Toast.LENGTH_LONG);
				toast.setGravity(Gravity.CENTER, 0, 0);
				LinearLayout toastView = (LinearLayout) toast.getView();
				ImageView image = new ImageView(getApplicationContext());
				image.setImageResource(R.drawable.icon);
				toastView.addView(image, 0);
				toast.show();

 


 

三、完全自定义Toast

 

LayoutInflater inflater = getLayoutInflater();
				View layout = inflater.inflate(R.layout.toast_item,(ViewGroup) findViewById(R.id.newToast));//慎用强转,一般使第二个参数为null
				ImageView image = (ImageView) layout.findViewById(R.id.imageView1);
				image.setImageResource(R.drawable.icon);
				TextView title = (TextView) layout.findViewById(R.id.textView1);
				title.setText("标题");
				TextView text = (TextView) layout.findViewById(R.id.textView2);
				text.setText("完全自定义Toast");
				Toast toast = new Toast(getApplicationContext());
				toast.setGravity(Gravity.RIGHT | Gravity.TOP, 12, 40);
				toast.setDuration(Toast.LENGTH_LONG);
				toast.setView(layout);
				toast.show();

 toast_item.xml

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="vertical">
	<LinearLayout
		android:id="@+id/newToast"
		android:orientation="vertical"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:background="@drawable/toast">
		<TextView
			android:text="TextView"
			android:id="@+id/textView1"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"></TextView>
		<ImageView
			android:layout_width="wrap_content"
			android:id="@+id/imageView1"
			android:src="/blog_article/@drawable/icon/index.html"
			android:layout_height="wrap_content"></ImageView>
		<TextView
			android:text="TextView"
			android:id="@+id/textView2"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:textColor="@color/black"></TextView>
	</LinearLayout>
</LinearLayout>
 



    
[3] ndk编译so的几个小问题
    来源: 互联网  发布时间: 2014-02-18
ndk编译so的几个问题

开始用ndk编译so,出了几个问题,先整理一下。希望以后遇到的人能省些力气。

 

1.

dr@drBox:~/workspace/JniTest/jni$ ~/android-ndk-r6/ndk-build 
Compile++ thumb  : Test <= JniTest.cpp
/bin/sh: /home/dr/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: not found
make: *** [/home/dr/workspace/JniTest/obj/local/armeabi/objs/Test/JniTest.o] Error 127

 这个错误是说找不到arm-linux-androideabi-g++,确实找不到,我从ndk r6中发现根本就没有linux-x86/文件夹,只有darwin-x86  gdbserver这两个文件夹,所以下载了最新的ndk r7b,幸好这里面有linux-x86文件夹,编译成功了。

 

dr@drBox:~/workspace/JniTest/jni$ ~/android-ndk-r7b/ndk-build 
Compile++ thumb  : Test <= JniTest.cpp
StaticLibrary  : libstdc++.a
SharedLibrary  : libTest.so
Install        : libTest.so => libs/armeabi/libTest.so

 

 

2.当只改动Android.mk文件后需要编译,这时mm执行后会报如下提示:

 

============================================
make: Entering directory `/home/dr/android4.0.3'
make: Nothing to be done for `all_modules'.
make: Leaving directory `/home/dr/android4.0.3'

 说明没有文件改动,拒绝编译。

 

那么解决办法可以是去稍微改动一下cpp等文件,加个空格也行。但是还有一种方便的方式就是

 

给cpp文件加时间戳:touch *.cpp

 

这样就可以继续编译了,所有cpp文件的时间都更新为最新了。

 

 

 

 


    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3