Friday, August 26, 2016

node.js - Gradle "... occurred starting process 'command 'npm''" on Mac

When  you use the react-native  build release APK;

if you meet this question:

node.js - Gradle "... occurred starting process 'command 'npm''" on Mac

you must use this command in the Root Project

react-native start      or   npm start

If the terminal always show:  the error infos:

you must in the android/dir  use this  command:
./gradlew --stop

无法查询北京公积金的余额?

注意:

公积金查询数据每周三、周五更新(16:00——21:00)

怎么说呢?

垃圾!

Thursday, August 25, 2016

Notification using setFullScreenIntent() for BigTextStyle opening Activity automatically


昨天,遇到一个很头疼的问题。收到服务器的推送之后,APP重新启动了。但是,测试里面还不报错。

找了半天,找到问题的根源是因为 Notifacation 的问题:

用了 serFullScreenIntent();

这个方法在Android6.0 以下没有任何的问题。 但是在Android 6.0 中的,小米的手机上面,至于其他的手机,我只测试了三星没有问题。至于其他的手机,没有测过。

所以这个地方昨个版本判断就好了:
if(Build.VERSION.SDK_INT < 23){
    //Android 6.0 一下的版本没什么问题。 可以正常弹窗    mBuilder.setFullScreenIntent(pendingIntent, true);}else{
    //Android 6.0 小米貌似做了深度的定制,然后会重新启动APP. 三星的没有问题, 其他的机型不详}


待优化:   这个地方,这样做有点暴力。应该是,那个版本有问题就解决那个,我现在是把Android6.0 一棒子全部打死了。你可以尝试自己写一个工具类: 判定用户的手机是不是小米的手机, 如果是小米的手机,就不设置serFullScreenIntent();

解决问题很简单,但是,时间基本上都花在了寻找问题上。定位问题上面了!


很多的时候,都是这个样子。解决起来很快,但是定位问题比较的麻烦!

Wednesday, August 24, 2016

android how to resolve compile release APK, Proguard error: "Warning:"


  今天在打正式包的时候,突然报错了。 让我有点懵逼了。然后, 打正式包的时候报错了。

解决方案:
就是在代码混淆的时候,去掉这些 waring:


例如 :
# android 6.0 SDK 23 start-dontwarn com.nhaarman.listviewanimations.** { *; }
-dontwarn com.solok.datetime.** { *; }
-dontwarn com.tencent.connect.avatar.** { *; }
-dontwarn com.viewpagerindicator.LinePageIndicator.** { *; }
-dontwarn uk.co.senab.photoview.** { *; }



# android 6.0 SDK 23 end


OK 你看一下你的报错的信息里面,需要注释的 warning 一一添加就可以了!

这里解析一下:
因为,我把编译的版本提高了23,所以,就会出现一些工具方法过时的问题。因为, Android 6.0 废弃了很多没有用的方法。所以,导致了我们在适配6.0 的时候,很多依赖的第三方可能还没有适配6.0 ,所以出现了这么多的warning!

其实,很多的第三方的一些类,我们根本没有用到。这里直接在混淆文件里面直接 使用 dontwarn  就可以了,但是,如果自己的写的依赖库, 可能用到了 过时的方法。这个时候,我们就要手动的去修改依赖库的代码了!


这样说吧:
--dontwarn  只是不报错,只是治标不治本
修改原生代码,  根治这个问题


error info:

Initializing...
Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService'
Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService'
Note: the configuration refers to the unknown class 'com.facebook.react.uimanager.UIProp'
Note: the configuration refers to the unknown class 'sun.misc.Unsafe'
Note: the configuration refers to the unknown class 'com.eallcn.rentagent.orm.SugarRecord'
      Maybe you meant the fully qualified name 'com.orm.SugarRecord'?
Note: the configuration refers to the unknown class 'com.eallcn.chow.entity.RepTrend'
      Maybe you meant the fully qualified name 'com.eallcn.rentagent.entity.common.RepTrend'?
Note: the configuration refers to the unknown class 'com.nhaarman.listviewanimations.itemmanipulation.dragdrop.DynamicListViewTestActivity'
Note: the configuration refers to the unknown class 'com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.SwipeTouchListenerTestActivity'
Note: the configuration refers to the unknown class 'se.emilsjolander.stickylistheaders.StickyListHeadersListView'
      Maybe you meant the fully qualified name 'com.eallcn.rentagent.widget.sticky.StickyListHeadersListView'?
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find superclass or interface se.emilsjolander.stickylistheaders.StickyListHeadersAdapter
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersAdapter
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersAdapter
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersAdapter
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersAdapter
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.appearance.StickyListHeadersAdapterDecorator: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.nhaarman.listviewanimations.util.StickyListHeadersListViewWrapper: can't find referenced class se.emilsjolander.stickylistheaders.StickyListHeadersListView
Warning: com.solok.datetime.WheelImageView: can't find referenced method 'float ceil(float)' in library class android.util.FloatMath
Warning: com.solok.datetime.WheelView: can't find referenced method 'float ceil(float)' in library class android.util.FloatMath
Warning: com.tencent.connect.avatar.c: can't find referenced method 'float sqrt(float)' in library class android.util.FloatMath
Warning: com.viewpagerindicator.LinePageIndicator: can't find referenced method 'float ceil(float)' in library class android.util.FloatMath
Warning: uk.co.senab.photoview.PhotoViewAttacher: can't find referenced method 'float sqrt(float)' in library class android.util.FloatMath
Warning: uk.co.senab.photoview.gestures.CupcakeGestureDetector: can't find referenced method 'float sqrt(float)' in library class android.util.FloatMath
Note: android.support.v4.media.IMediaBrowserServiceCallbacksAdapterApi21: can't find dynamically referenced class android.service.media.IMediaBrowserServiceCallbacks
Note: android.support.v4.media.IMediaBrowserServiceCallbacksAdapterApi21: can't find dynamically referenced class android.content.pm.ParceledListSlice
Note: android.support.v4.media.IMediaBrowserServiceCallbacksAdapterApi21$Stub: can't find dynamically referenced class android.service.media.IMediaBrowserServiceCallbacks$Stub
Note: android.support.v4.media.ParceledListSliceAdapterApi21: can't find dynamically referenced class android.content.pm.ParceledListSlice
Note: android.support.v4.text.ICUCompatApi23: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v7.widget.DrawableUtils: can't find dynamically referenced class android.graphics.Insets
Note: com.alibaba.fastjson.parser.ParserConfig: can't find dynamically referenced class java.awt.Point
Note: com.alibaba.fastjson.parser.ParserConfig: can't find dynamically referenced class java.awt.Font
Note: com.alibaba.fastjson.parser.ParserConfig: can't find dynamically referenced class java.awt.Rectangle
Note: com.alibaba.fastjson.parser.ParserConfig: can't find dynamically referenced class java.awt.Color
Note: com.alibaba.fastjson.serializer.SerializeConfig: can't find dynamically referenced class java.awt.Color
Note: com.alibaba.fastjson.serializer.SerializeConfig: can't find dynamically referenced class java.awt.Font
Note: com.alibaba.fastjson.serializer.SerializeConfig: can't find dynamically referenced class java.awt.Point
Note: com.alibaba.fastjson.serializer.SerializeConfig: can't find dynamically referenced class java.awt.Rectangle
Note: com.baidu.location.b.d$a: can't find dynamically referenced class android.os.SystemProperties
Note: com.baidu.location.b.e: can't find dynamically referenced class android.os.storage.StorageVolume
Note: com.baidu.platform.comapi.util.e: can't find dynamically referenced class android.os.storage.StorageVolume
Note: com.facebook.common.webp.WebpSupportStatus: can't find dynamically referenced class com.facebook.webpsupport.WebpBitmapFactoryImpl
Note: com.facebook.imagepipeline.animated.factory.AnimatedFactoryProvider: can't find dynamically referenced class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImplSupport
Note: com.facebook.imagepipeline.animated.factory.AnimatedFactoryProvider: can't find dynamically referenced class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl
Note: com.facebook.imagepipeline.nativecode.WebpTranscoderFactory: can't find dynamically referenced class com.facebook.imagepipeline.nativecode.WebpTranscoderImpl
Note: com.google.common.util.concurrent.MoreExecutors: can't find dynamically referenced class com.google.appengine.api.ThreadManager
Note: com.google.common.util.concurrent.MoreExecutors: can't find dynamically referenced class com.google.apphosting.api.ApiProxy
Note: com.google.gson.internal.UnsafeAllocator: can't find dynamically referenced class sun.misc.Unsafe
Note: com.hyphenate.chat.EMPushHelper: can't find dynamically referenced class com.google.android.gms.common.GooglePlayServicesUtil
Note: com.hyphenate.chat.EMPushHelper: can't find dynamically referenced class com.xiaomi.mipush.sdk.MiPushClient
Note: com.parse.ParseHttpClient: can't find dynamically referenced class com.squareup.okhttp.OkHttpClient
Note: com.sina.weibo.sdk.utils.AidTask: can't find dynamically referenced class android.os.SystemProperties
Note: com.tencent.mm.sdk.platformtools.NetStatusUtil: can't find dynamically referenced class android.app.ActivityManagerNative
Note: com.tencent.mm.sdk.platformtools.NetStatusUtil: can't find dynamically referenced class android.net.NetworkPolicyManager
Note: de.devland.esperandro.Esperandro: can't find dynamically referenced class de.devland.esperandro.serialization.GsonSerializer
Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: org.jivesoftware.smack.XMPPConnection: can't find dynamically referenced class sun.security.pkcs11.SunPKCS11
Note: org.jivesoftware.smack.compression.JzlibInputOutputStream: can't find dynamically referenced class com.jcraft.jzlib.ZOutputStream
Note: org.jivesoftware.smack.compression.JzlibInputOutputStream: can't find dynamically referenced class com.jcraft.jzlib.ZInputStream
Note: there were 9 references to unknown classes.
      You should check your configuration for typos.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 38 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Warning: there were 21 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 6 unresolved references to library class members.
         You probably need to update the library versions.
         Alternatively, you may have to specify the option
         '-dontskipnonpubliclibraryclassmembers'.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForMlwRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForMlwRelease'.
> java.io.IOException: Please correct the above warnings first.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED


Thursday, August 18, 2016

react native 的原理解析

最近,学习了React Native ,开始的时候,真的是一头雾水的感觉。丈二和尚摸不到头脑,今天总结一下,这几天学到的东西。

我觉的,react-native 

实现目的: 热更新

1  这里Node.js 作为服务,开启一个本地的Socket流, 监听本地的8081 端口。 当你使用 react-native start 或者  npm start.  他就像是一个依赖仓库一样,她不会主动的更新,当你不发起请求的时候,她是不会更新的。 尽管,你本地的 js 代码已经更新了。 
奥, 原理,Node.js  把你本地写的js 文件,当做组件(相当于Android 里面jcenter 的依赖库),当你用户出发更新到时候, node 会自动的更新组件库。


Android “Could not get BatchedBridge, make sure your bundle is packaged properly”

今天,刚把项目集成到 React-Native  里面,安装的时候没什么问题。但是,打开的时候,出现了问题,
如图:




如何解决:
参考:


针对Mac:
第一步: 
打开你的terminal
进入你的ReactNative 初始化的根目录里面。
然后, 运行下面这行命令



curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"

这行命令是把你本地的 jsBundle 下载到你的 android/app/src/main/assets/index.android.bundle

如果没有 assets目录的自己新建一个就可以了!

当你再次打包的时候,就把你的本地的Js打包进去了。这个时候,你就可以进行测试了!


本人测试没什么问题!



















Wednesday, August 17, 2016


Android React Native: com.android.ddmlib.InstallException: Failed to establish session at com.android.ddmlib.Device.installPackages(Device.java:894)

今天集成 React_Native 的时候,初始化了项目之后,使用使用react-native run-android 命令老是报错:
如下:



如标题, adb  无法连接你的真机。

其实,react-native run-android   并不实用。 因为,我们可能需要一套代码去实现多个APP. 这个时候,就好用了!

我在Github 上找到参考资料:
https://github.com/facebook/react-native/issues/2720






解决方案:  

不要使用它的命令。

1  开启 react-native server 使用这个命令
react-native start  or   npm start.

注意,这个要在你的 react-native 的根目录里面而不是 android目录下奥!

2   进入你的android  dir

先不要打包,这个时候,你要先把react-native server 的jsBundle 下载下来,才可以打包,要不然会出现下面的问题:




在你的根目录下面先执行:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"


使用 gradlew  命令打包。把你的包安装到 手机上之后。


3  这个时候,你打开APP.  找到你的app.  打开设置界面。 找到的APP 给APP一个权限。

APP设置界面:



点击权限管理:




显示悬浮穿给到权限: 就可以了!

进入的你写的Demo.

晃动你的手机,就会出现:



点击 Dev Setting 

点击最下面的Item 会出现:




配置你的电脑的IP地址,和端口

IP:PORT

注意,这里的port 端口是 react-native server 端口, 如果你没有修改的话,默认的是8081 端口!

这个时候就可以了,当你修改了 js 代码的时候,晃动一下手机,就会弹出:



当你 点击Reload 的时候,就会从react-native server 端把你修改的Js 代码,自动更新下来的。从而更新View.


FQ:

1  当你 react-native start or  nom start 
不成功的时候,有可能你的已经开启了服务。或者你的电脑的8081 端口已经被占用了!

查看端口是否被占用,方式自己搜搜
Mac:

lsof -n -i4TCP:8081 | grep LISTEN



这里如果现实 node,说明的你的服务已经开起来了。 不需要重复开启了。 如果是其他的 不是node,你需要干掉这个进程。在开启就没有问题了!





Monday, August 15, 2016

React Native 遇到的问题


安装了React_native 初始化项目的时候不成功? 


react-native init HadesDemoRn                             


This will walk you through creating a new React Native project in /Users/Hades/Hades/Code/RN/demo/HadesDemoRn
Installing react-native package from npm...


解决方案:
To everyone having problems with project creation: 
With next version of React Native CLI you can use --verbose option to get a clue what's going on:
react-native init MyAwesomeProject --verbose

你为了什么活着?

  有很多人,活了大半辈子,搞不清楚自己到底为了什么活着?
  生活,每种可能都会有的,正是因为这种 不可预测性,我们的生活才能如此的精彩。
  现在的生活,大多数只是为了钱。似乎,都是在了钱活着。忘记了自己的初心!当你老了,你这辈子除了钱,什么都没有的时候,你会发现自己的其实是很贫穷的。自己的人生就这样没了?其实,很多的时候,我们都是太安逸了。不愿意去改变的现状。得过且过,最终会知道其实,这样做有很大的问题的!因为,当你老去的那一天,其实你的人生可以过的更好的。但是,现在的你,已经没有时间和能力,去做自己了。现在的自己的,在最好的年华,却始终窝在家里面。每个周末过的都有点颓废的感觉。这让我感觉就是在浪费自己的青春。我们的青春是有限的。我们唯一浪费不起的就是自己的青春。我们最宝贵的是健康的身体。然后,就是自己的时间。君子必甚其独也!
  修身养性齐家治国平天下

  一屋不扫何以扫天下

  如何让自己变的更好?

  自己一生的课题。需要自己更加的努力。不是只顾眼前的利益。如何让自己变的更强,今天看的宝强的电影。如果,你自己混不好的话,是没有人看的起你的?你知道吗?现在的你可以任性。但是,等你老了。你任性是因为,周围的人让着你。但是,真的上了社会上之后,你会发现。其实很多的事情,都是跟自己的意愿相反的。不是你不想,而是,生活是不会按照你的意愿进行的。因为,你不是神。

  我的生活中,似乎太过于在乎,他们的成功了,但是,其实,他们过的未必就有我过的开心。这是真的,因为,家家有本难念的经。生活,从来都不是一帆风顺的,只有做好了一切的心里准备。你才能从容的面对一切的困难。

  记住,在你困难的时候,处理你自己,没有人可以帮你的知道吗?现在的你,似乎是没有什么发愁的事情,但是,做人要居安思危。很多的事情,不要老是拖拉,拖拉解决不了任何事情。能今天解决的绝不要拖到明天,因为,很多人死在今天晚上。等不到明天,生活就是这样的美好。因为,死亡,所以我们要珍惜活着的时光

看着别人,无法正常的生活,他们都在努力的活着。正所谓,好死不如赖活着!生活的美丽正在于的她的不可预知。假如,你洞察天机了。你知道自己的一生,你的一声活着还有什么意义?人生正因为,你不知道下一秒会发生什么?你才会更加的珍惜现在的时光。时间,是我们的基石,但是健康才是一切的基础,假如没有了健康。你觉得你的人生该怎么办呢?

  





Tuesday, August 2, 2016

ProductFlavors 和 debug release

Android Studio  如果做了多个项目的区分, 就是你的项目,被多家公司使用,使用的包名不唯一。  这个时候,你没有办法通过名字区分  是正式版本 还是测试版本?

但是,有的时候 需求需要, 当你的测试包和正式包 包名一样的时候,你真的没有办法处理!

解决方案:

在build.gradle 中 使用 resValue

这样设置你的build.gradle
apply plugin: 'com.android.application'
android {
    println("===============  android")

    compileSdkVersion 23    buildToolsVersion "23.0.2"
    defaultConfig {

        println("===============  defaultConfig")

        applicationId "test.geekhades.com.productflavorsanddebug"        minSdkVersion 19        targetSdkVersion 23        versionCode 1        versionName "1.0"    }

    signingConfigs {

        debug {
            println("===============  signingConfigs.debug")

        }

        release {
            println("===============  signingConfigs.release")
        }
    }

    buildTypes {

        debug {
            println("===============  buildTypes.debug")

            applicationIdSuffix project.APP_IS_DEBUG            resValue 'string', 'app_name', "测试版"            buildConfigField "boolean", "IS_DEBUG", "true"            IS_RELEASE=false            println("===============  buildTypes.debug IS_RELEASE" + project.IS_RELEASE)
        }

        release {
            println("===============  buildTypes.release")

            minifyEnabled false            IS_RELEASE=true            println("===============  buildTypes.debug IS_RELEASE" + project.IS_RELEASE)

            buildConfigField "boolean", "IS_DEBUG", "false"            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }
    }

    productFlavors {



        mlw {
            println("===============  productFlavors.mlw")

            //mlw  美丽屋            applicationId project.MLW_PACKAGE_NAME            versionCode Integer.parseInt(project.MLW_VERSION_NAME.replace(".",""))
            versionName project.MLW_VERSION_NAME            manifestPlaceholders = [umengHolder: "anzhi"]

            println("===============  buildTypes.debug IS_RELEASE" + project.IS_RELEASE)

            resValue 'string', 'app_name', "美丽屋经纪人"        }

        gjb {
            println("===============  productFlavors.gjb")

            //gjb  管家宝            applicationId project.GJB_PACKAGE_NAME            versionCode Integer.parseInt(project.GJB_VERSION_NAME.replace(".",""))
            versionName project.GJB_VERSION_NAME
            manifestPlaceholders = [umengHolder: "anzhi"]

            println("===============  buildTypes.debug IS_RELEASE" + project.IS_RELEASE)

            resValue 'string', 'app_name',  "管家宝"        }

    }


}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'    compile 'com.android.support:appcompat-v7:23.4.0'}


在buildType.debug 中设置 app_name

这个时候设置的 debug的版本


在 ProductFlavors 中设置的是正式版本的label

解决!




Gradle build_lifecycle

https://docs.gradle.org/current/userguide/build_lifecycle.html


Android studio app:  

build.grade 是如何执行?

下面 并不是 Gradle 执行周期,仅仅是脚本的初始化的时候,把所有的设置加载了一遍!

Monday, August 1, 2016

关于世界的思考

这个世界上,假如没有钱,你连饭都吃不上的时候。你心里的愿望就是吃上一顿包餐,就会感到很满足和幸福。当你有饭吃的时候,你有希望有一份不错的工作,体现自己的价值,这个时候又在纠结如何获取一份不错的工作,薪水不用太高,够自己的吃的就可以了!当你,有一份还可以的工作的时候,薪水还可以,你并没有感到满足,而是,在和别人攀比。为什么他跟我薪水差不多,但是比我的快乐呢?因为,你是租房子,而他有自己的房子。于是,你心里面又想,我要是有一套房子那该多好呀!分了十几年之后,你终于有自己的房子了!有了房子之后,感却还是少点什么东西,奥,原来自己的还少一辆车呀,于是,你又攒了两年的钱,买了一辆车。花了10万左右。有了车的时候,你已经快37岁了。然后,自己单身了小半辈子了,是不是该找个伴了?找什么样的呢?找跟自己同岁的吧,基本上都有孩子了!找比自己小的吧! 找个20几岁的吧,等你老了,她还很年轻。哈哈,也是纠结中度过了。等到了40岁的时候,你没有办法在等了,你找了一个结婚的小女孩。过了两年,你有了自己的孩子,我不会找比自己打的女孩子。我不要像琪琪一样的啥,找了一个比自己大两岁的女孩子,现在开始着急了,因为女孩子跟男孩子不一样的,我们可以等到30岁结婚,但是,她们等不起的。女孩子的家里面的人也是,七嘴八舌的,因为在我们乡下的人,一般是 十七八岁的时候就已经结婚了。向我们这些上完大学就24随了,真的是有点鸡肋了。哈哈,一毕业的时候,家里面就催着结婚的女孩子,有很多。其实,很多毕了业之后就去结婚了。其实也挺好的!

   像我这样的小屌丝们,没有办法,只能指望自己的。怀揣着梦想和理想来了大城市打拼,想象着打下自己的一片天地。让自己的家人过的更加的幸福。如果,拿着的健康在拼命赚钱。等到40岁的时候,我们的身体不行了,就开始那前半辈子挣的钱养身体。发现,挣得那点钱根本 不够花的,哈哈!

  是的,我们一辈子,似乎都是在对比着度过自己的一生。我们真的没有时间,停下来思考一下,自己的这一辈是为什么活着?自己的就是不停的忙碌着。很多的时候,我们忘记了自己的梦想,满脑子里面只有金钱了。是的,这是一个金钱的社会,假如,没有钱,你会被饿死的。然后,你不断的攀比着过日子。你永远都不会开心的,因为,你想要得到的都是跟你的显示不切实际的存在。是的,我们没有办法。总是在想得到一些超过我们实际能力的事物。 说白了,就是在透支自己的未来。然后,让自己背着巨大的包袱在 蠕动。那个时候的我,已经被生活麻木了。基本上没有丝毫的激情可言的。活着的唯一的目的,就是还这个月的房贷,哈哈,说起来真的是很可笑的。我们生不来,死了有带不走的东西。我们这辈子追求的都是一些外物的东西。很少,追求心灵上的满足,这是基督教义好的地方,她让我们以感恩的心,感激的活着。个人觉的基督教的教义要比佛教的好很多,佛教活着是为了赎罪,让人们忍者,忍受所有的一切。这辈子所做的一切都是为了,下辈子的享福。

我不知道,是不是真的有轮回这一说,我是比较喜欢基督教的,因为以一颗感恩的心活着。会让自己感觉很开心和幸福的。如果,你只知道攀比的活着。你的人生没有任何的价值。你的一生都是活在别人的世界里面的。没有自己的思考,只是一个盲流子而已。

追求自己内心的安逸是一方面。另一方面,我追求的外物是为了让我更好的活着,当我的生活水平提上来了之后,就很难降下去的。这是真的。

这个世界有两种事物,一种是可以用钱来衡量的。一种是不能用钱来衡量的。 

在大学的时候,爱情是不能用钱来衡量的,但是大学毕业之后,爱情是用钱来衡量的。

现在的我,在追求什么?在追求自我?认识自我,让自己的变的更加的完美。让自己的变的更强,让自己的变的更好。培养的自己的世界观,人生观,价值观。学会如何做人?如何交友?如何学习?如何学会习惯独孤?君子必慎其独也!

记住 救急不救穷