您的位置:首页 > 移动开发 > Android开发

工作中的积累

2016-04-07 14:25 513 查看
eclipse新建的项目R文件出不来  加的权限

sudo chmod 777 adt-bundle-linux-x86_64-20140702 -R    在eclipse的根目录下在终端中打开执行此命令

如果导入项目报错,选中项目在eclipse中的菜单栏protect中Build Protect

由于应用层依赖于底层,有的错可能依赖于安卓隐藏的API,可以直接忽略,

直接在命令窗口编译成apk文件在项目对应的终端运行测试。

Subversion 是版本控制工具。

详细资料:http://subversion.apache.org/

 

《Android系统源代码情景分析》作者:罗升阳

smb://192.168.1.8        访问服务器

svn co svn://192.168.1.8/JK35_3IN1/trunk  从服务器下载Q42工程

编译命令    ./build_userdebug.sh

1. source build/envsetup.sh

2. lunch 命令后选择 lentk6735m_65c_l1 对应的eng或者user分支;

3. mmm packages/apps/Contacts

./mk mm packages/apps/Dialer/   在trunk目录下编译成apk

adb remount    进入apk所在的目录下->在终端中打开命令-->更新目录

adb push ***.apk system/app 进入apk所在的目录下->在终端中打开命令-->将编译好的apk文件push到手机上

grep "toolbar_parent" * -Rn    在packages/apps/Contacts/下使用终端打开  查找项目下所以包含toolbar_parent的所有文件

svn up packages/apps/ipLauncher 在trunk目录下->在终端中打开命令-->对指定的项目进行升级

svn diff packages/apps/ipLauncher 比较本地项目和svn服务器上对应的项目不同

属性动画的折叠与展开

    private int mRecentAppsHeight;

    private ValueAnimator.AnimatorUpdateListener animatorUpdateListener=new ValueAnimator.AnimatorUpdateListener() {

        @Override

        public void onAnimationUpdate(ValueAnimator animation) {

            ViewGroup.LayoutParams params = mRecentApps2.getLayoutParams();

            params.height=(Integer) animation.getAnimatedValue();

            mRecentApps2.setLayoutParams(params);

        }

    };

    public void onOpenFoldButtonClick(View v) {

            Button button = (Button) findViewById(R.id.button);

        mRecentAppsHeight=mRecentApps.getHeight();

        Button button = (Button) findViewById(R.id.button);

        if (button.getText().equals(getString(R.string.open))){

            

         ObjectAnimator anim = ObjectAnimator.ofInt(mRecentApps2, "",mRecentApps2.getHeight(),mRecentAppsHeight).setDuration(300);

         anim.start();

         anim.addUpdateListener(animatorUpdateListener);

         button.setText(R.string.fold);

        }else if (button.getText().equals(getString(R.string.fold))){

         ObjectAnimator anim1 = ObjectAnimator.ofInt(mRecentApps2, "", mRecentApps2.getHeight(), 0).setDuration(300);

         anim1.start();

         anim1.addUpdateListener(animatorUpdateListener);

         button.setText(R.string.open);

        }

      }

编写仿IOS计算器的横竖屏界面

dp的定义:

Density-independent pixel (dp)独立像素密度。标准是160dip.即1dp对应1个pixel,计算公式如:px = dp * (dpi / 160),屏幕密度越大,1dp对应 的像素点越多。

上面的公式中有个dpi,dpi为DPI是Dots Per Inch(每英寸所打印的点数),也就是当设备的dpi为160的时候1px=1dp;

给eclipse配置android 6.0 SDK

鸟哥的Linux私房菜-基础学习篇(表示看的人头疼... ...)

任务:把android 6.0 的通知栏整合成iPhone界面的通知栏

NotificationMediaViewWrapper    通知媒体视图包装器

NotificationTemplateViewWrapper    通知模板视图包装器

NotificationOverflowContainer    通知过流容器

NotificationGroupManager    通知组管理

Notificat    ionPanelView        通知面板视图

NotificationsQuickSettingsContainer    通知快速设置容器

NotificationCustomViewWrapper    通知自定义视图包装器

NotificationOverflowContainer    通知过流容器

StatusBarWindowView    状态栏窗口视图

status_bar_expanded_header.xml 状态栏扩展头 布局文件

Q66编译

    source build/envsetup.sh

lunch

full_nb6755_66_m-userdebug

    mmm frameworks/base/packages/SystemUI/

adb push SystemUI.apk system/priv-app/SystemUI

修改6.0版本文件

status_bar_expanded_header.xml

String.xml

dimen.xml    

PhoneSatusBar.java 第961行    加载的下拉通知的布局

    NullPointException未解决

    在把v4包导入后还需要在Android.mk文件中加上:LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4 代码,    核查代码

android:sharedUserId

userid的特点:

1. 作为APK身份的标识 2. userid对应一个Linux用户,所以不同APK(用户)间互相访问数据默认是禁止的.

 Android为我们提供了两种数据互访的方法:

一是使用Share Preference. / Content Provider

APK通过指定接口和数据供其它APK读取,开发者需要实现接口和指定share的数据。【此方法后面再详细讲解】

二是在配置文件manifest中配置相同的UserId

通过共享userid,拥有相同userid的用户可以配置成运行在同一进程当中,因此默认就是可以互相访问任意数据的

也可以配置为不同进程当中,彼此之间就像访问自己的数据一样访问彼此的数据库和文件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android