2015年12月18日星期五

2015年12月3日星期四

Push and install APK to different on PC connected devices

There's one classical problem for multi-devices that connect onto PC when we develop Android. You cannot push or install apk by command-line when more than one on it. Fine you can use two steps to do this:

1. Find devices:
    # adb devices -list

2. Select  one or more serial-numbers in your head.

3. Run:
   #  adb -s serial-number install -r  ../asdfasdf/hello.apk

That works but only for one device.

I've packed this command in to a batch and we can do with more than one devices.

Just run:  
   # installapk --all ../asdfasdf/hello.apk 
or
  # installapk serial-number serial-number serial-number serial-number ../asdfasdf/hello.apk 


Try and fork it.

P.S There's also a program to uninstall application from devices.
The command-line to uninstall app is easy like install by instead typing path of apk by package name:

# uninstallapp --all com.helloworld
or
# uninstallapp 23445345sdf sdffsdg com.helloworld

Try



2015年11月30日星期一

Should I move API level to 14

It is an interesting question.  Some % is still in the list of current version fragments.

Is it a real time to switch normal development to API 14 (android 4.0) ?


2015年11月28日星期六

Permissions type: what "must" be done and "can" be done.

If we develop with SDK >= android 6.x (target 2.3 or above) then we need permission check before application starts. It is so nice for user to let them know what the application needs, however for developer is f"x", because the codes need refactoring. There're some "know-how" to do this, even with some 3rd libraries can simplify the functions like https://github.com/hotchemi/PermissionsDispatcher .


I used this library in my projects for permission check for android 6.x.  However there's two parts of permissions which we can be granted. First one are normal ones that only should be declared in mainfest like before  (PROTECTION_NORMAL). The other part of it is the ones that not only be written in mainfest but also in your Java codes to test. Like with PermissionDispatcher you must give user system build-in popup to grant next route.


Automatically granted permissions :

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_NOTIFICATION_POLICY
android.permission.ACCESS_WIFI_STATE
android.permission.ACCESS_WIMAX_STATE
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission.BROADCAST_STICKY
android.permission.CHANGE_NETWORK_STATE
android.permission.CHANGE_WIFI_MULTICAST_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.CHANGE_WIMAX_STATE
android.permission.DISABLE_KEYGUARD
android.permission.EXPAND_STATUS_BAR
android.permission.FLASHLIGHT
android.permission.GET_ACCOUNTS
android.permission.GET_PACKAGE_SIZE
android.permission.INTERNET
android.permission.KILL_BACKGROUND_PROCESSES
android.permission.MODIFY_AUDIO_SETTINGS
android.permission.NFC
android.permission.READ_SYNC_SETTINGS
android.permission.READ_SYNC_STATS
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.REORDER_TASKS
android.permission.REQUEST_INSTALL_PACKAGES
android.permission.SET_TIME_ZONE
android.permission.SET_WALLPAPER
android.permission.SET_WALLPAPER_HINTS
android.permission.SUBSCRIBED_FEEDS_READ
android.permission.TRANSMIT_IR
android.permission.USE_FINGERPRINT
android.permission.VIBRATE
android.permission.WAKE_LOCK
android.permission.WRITE_SYNC_SETTINGS
com.android.alarm.permission.SET_ALARM
com.android.launcher.permission.INSTALL_SHORTCUT
com.android.launcher.permission.UNINSTALL_SHORTCUT

Just simply declare those permissions in AndroidManifest.xml and it will work just fine. No need to check for the permission listed above since it couldn't be revoked.

The permissions must be checked:



2015年11月20日星期五

Debug with wifi for android dev

  1. Connect device via USB and make sure debugging is working.
  2. adb tcpip 5555
  3. adb connect <DEVICE_IP_ADDRESS>:5555
  4. Disconnect USB and proceed with wireless debugging.
  5. adb -s <DEVICE_IP_ADDRESS>:5555 usb to switch back when done.

2015年11月17日星期二

IT Books 3.0 released

New version includes Google Login, Google Drive to save books,  Material Design on detail-view.

The new Google Login by new Google SigIn API  which provides easy way to connect on Google. A lot confused codes are removed when login and new thinking of App-Flow is created:

1. App start without account.
2. Some features depending on account will be first hidden or unavailable.
3. App connects to account.
4. Features will be opened.


Google Drive is a very nice place to save data background permanently.  With integration of Drive SDK Android  we can implement  backup very easily.  The SDK controls whole upload and download process as user doesn't take any care on network transactions. The only ones to do is success-handling and error-handling to info UI.


To the detail-view the CoordinatorLayout is used to replace my own implement. The standard behavior with FAB and progress-toast cooperate downloading process dynamically.  Checkout a simple sample of  CoordinatorLayout here https://github.com/chrisbanes/cheesesquare

IT Books 3.0


P.S App has a new icon now :)





2015年11月3日星期二

Topfeeds API updated

I updated API to fetch some latest tech-news from China or lots from who hosted by www.blogger.com.

SDK has also been updated.

"Developer Daily" runs internationally.

The Android-App "Developer Daily" which is known as "IT Daily News" or "Developer Daily News" has been updated with international data-source.

The first group of international data is from Android Developer Blog, Google Developer Blog, Android Official Blog, Google Official Blog, Golang Blog, Google Cloud Platform Blog. Including former Chinese source, the application is now available for west users.

The idea of "Developer Daily" is not a beautiful app with to many animation etc, the target of this gadget is only to catch latest what happening in the developer world like Android, Google , might be Apple .

Almost every developer sits on the his desk to code and code without time to read what's going on in his tech-world.  Obversely by using this small tool-kit developer can get latest information just on the way to work. To obtain latest info is more important than standby.

More an more news source will be added into.

Download:




P.S I updated API to fetch some latest tech-news from China or lots from who hosted by www.blogger.com.

SDK has also been updated.


2015年10月27日星期二

Facebook sharing in WhatsUp News, new update for "Developer Daily News"

I've just added standalone sharing on Facebook for WhatsUp in order to avoid bug of pre-install sharing. In new version of application user can now share news directly from notification center including on Facebook.
Here download new version:


A second update is former "IT Daily News" with changing it application-name to "Developer Daily News", in Chinese “开发者快讯”.  New feature is Facebook-sharing in detail view and some bug fixings.
Here download new version:




2015年10月12日星期一

Android之手势的识别与处理(双击onDoubleTap、滑动onFling、拖动onScroll)

概述:

一般情况下,我们知道View类有个View.OnTouchListener内部接口,通过重写他的onTouch(View v, MotionEvent event)方法,我们可以处理一些touch事件,但是这个方法太过简单,如果需要处理一些复杂的手势,用这个接口就会很麻烦(因为我们要自己根据用户触摸的轨迹去判断是什么手势)。 
Android sdk给我们提供了GestureDetector(Gesture:手势Detector:识别)类,通过这个类我们可以识别很多的手势,主要是通过他的onTouchEvent(event)方法完成了不同手势的识别。虽然他能识别手势,但是不同的手势要怎么处理,应该是提供给程序员实现的。 
GestureDetector这个类对外提供了两个接口:OnGestureListener,OnDoubleTapListener,还有一个内部类SimpleOnGestureListener。 
GestureDetector.OnDoubleTapListener接口:用来通知DoubleTap事件,类似于鼠标的双击事件。 
1,onDoubleTap(MotionEvent e):在双击的第二下,Touch down时触发 。 
2,onDoubleTapEvent(MotionEvent e):通知DoubleTap手势中的事件,包含down、up和move事件(这里指的是在双击之间发生的事件,例如在同一个地方双击会产生DoubleTap手势,而在DoubleTap手势里面还会发生down和up事件,这两个事件由该函数通知);双击的第二下Touch down和up都会触发,可用e.getAction()区分。 
3,onSingleTapConfirmed(MotionEvent e):用来判定该次点击是SingleTap而不是DoubleTap,如果连续点击两次就是DoubleTap手势,如果只点击一次,系统等待一段时间后没有收到第二次点击则判定该次点击为SingleTap而不是DoubleTap,然后触发SingleTapConfirmed事件。这个方法不同于onSingleTapUp,他是在GestureDetector确信用户在第一次触摸屏幕后,没有紧跟着第二次触摸屏幕,也就是不是“双击”的时候触发 
GestureDetector.OnGestureListener接口:用来通知普通的手势事件,该接口有如下六个回调函数: 
1. onDown(MotionEvent e):down事件; 
2. onSingleTapUp(MotionEvent e):一次点击up事件;在touch down后又没有滑动 
(onScroll),又没有长按(onLongPress),然后Touchup时触发。 
点击一下非常快的(不滑动)Touchup: 
onDown->onSingleTapUp->onSingleTapConfirmed 
点击一下稍微慢点的(不滑动)Touchup: 
onDown->onShowPress->onSingleTapUp->onSingleTapConfirmed 
3. onShowPress(MotionEvent e):down事件发生而move或则up还没发生前触发该 
事件;Touch了还没有滑动时触发(与onDown,onLongPress)比较onDown只要Touch down一定立刻触发。而Touchdown后过一会没有滑动先触发onShowPress再是onLongPress。所以Touchdown后一直不滑动 
按照onDown->onShowPress->onLongPress这个顺序触发。 
4. onLongPress(MotionEvent e):长按事件;Touch了不移动一直Touch down时触发; 
5. onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY):滑动手 
势事件;Touch了滑动一点距离后,在ACTION_UP时才会触发 ; 
参数:e1 第1个ACTION_DOWN MotionEvent 并且只有一个;e2 最后一个ACTION_MOVE MotionEvent ;velocityX X轴上的移动速度,像素/秒 ;velocityY Y轴上的移动速度,像素/秒.触发条件:X轴的坐标位移大于FLING_MIN_DISTANCE,且移动速度大于FLING_MIN_VELOCITY个像素/秒 
6. onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY):在屏幕上 
拖动事件。无论是用手拖动view,或者是以抛的动作滚动,都会多次触发,这个方法在ACTION_MOVE动作发生时就会触发。
点击一下非常快的(不滑动)Touchup: 
onDown->onSingleTapUp->onSingleTapConfirmed 
点击一下稍微慢点的(不滑动)Touchup: 
onDown->onShowPress->onSingleTapUp->onSingleTapConfirmed

Demo

自定义Button控件,实现手势的监听和处理:
public class MyButton extends Button {

    private GestureDetector mGesture;
    private OnDoubleClickListener onDoubleClickListener;
    //自定义监听器接口
    interface OnDoubleClickListener{
        void onDoubleClick(View view);
    }
    //设置双击事件监听器的方法
    public void setOnDoubleClickListener(OnDoubleClickListener onDoubleClickListener){
        this.onDoubleClickListener = onDoubleClickListener;
    };

    public MyButton(Context context) {
        super(context);
    }

    public MyButton(final Context context, AttributeSet attrs) {
        super(context, attrs);
        //
        mGesture = new GestureDetector(context,new GestureDetector.SimpleOnGestureListener(){
            @Override
            public boolean onDoubleTap(MotionEvent e) {
                if(onDoubleClickListener!=null) {
                    onDoubleClickListener.onDoubleClick(MyButton.this);
                }
                Toast.makeText(context,"双击事件",Toast.LENGTH_SHORT).show();
                return true;
            }

            @Override
            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                /**
                 * 滑动和拖拽最好不要一起实现,会产生矛盾
                 */
                if(Math.abs(e1.getX()-e2.getX())>50){
                    setTranslationX(e2.getX() - e1.getX());
                    //根据手势滑动的距离而在水平方向上滑动控件
                    ObjectAnimator.ofFloat(MyButton.this,"translationX",getTranslationX(),e2.getX()-e1.getX())
                            .setDuration(500).start();
                    return true;
                }
                return super.onFling(e1, e2, velocityX, velocityY);
            }

            @Override
            public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
                //根据手势拖拽控件的相位而移动控件
                setTranslationX(getTranslationX()+e2.getX() - e1.getX());
                setTranslationY(getTranslationX()+e2.getY() - e1.getY());
                return super.onScroll(e1, e2, distanceX, distanceY);
            }
        });
    }

    public MyButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent event) {
        if(event.getAction()==MotionEvent.ACTION_DOWN){

        }
        return super.dispatchTouchEvent(event);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        //touch事件传给onTouchEvent()
        mGesture.onTouchEvent(event);
        return super.onTouchEvent(event);
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:context=".MainActivity">

    <com.example.administrator.selfishgroupview.MyButton
        android:id="@+id/button_doubleTap"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="点击"/>
</RelativeLayout>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
主活动:
public class MainActivity extends Activity {

    private MyButton myButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        myButton = (MyButton) findViewById(R.id.button_doubleTap);
        myButton.setOnDoubleClickListener(new MyButton.OnDoubleClickListener() {
            @Override
            public void onDoubleClick(View view) {
                Log.d("","点击两次");
            }
        });
    }

}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

2015年9月11日星期五

12 häufige Fehler beim Programmieren lernen(from http://www.java-forum.org/thema/12-haeufige-fehler-beim-programmieren-lernen.168177/)

1. Versuch, neues Wissen gleich krampfhaft aufsaugen zu wollen
Einer der häufigsten Fehler: Von Anfang an alles aufsagen wollen. Viele Anfänger versuchen gleich in den ersten Vorlesungen, bei den ersten Seiten im Buch oder dem Anfang von einem Tutorial einzelne Stichwörter zu behalten. Das funktioniert zum einen eh nicht. Auf der anderen Seite nimmt man sich die Chance, ganz entspannt den Beispielen und Erklärungen zu folgen.
Man muss auch sehen: Es demotiviert unglaublich. Es kommt gar nicht richtig in einen Lesefluss oder ähnliches. Klar darf man z.B. mit einem Textmarker arbeiten. Wir empfehlen aber ausdrücklich: Besser erst einmal komplett lesen oder zuhören und vor allem: verstehen!

2. Zu viel theoretisch Arbeiten
Ein großer Faktor bei der Programmierung ist die Praxis. Das ist mit dem Lernen einer Sprache vergleichbar.
Nehmen wir als Beispiel die englische Sprache: Man kann Bücher über Grammatik lesen, englische Lieder hören und Filme im Originalton hören. Ja, selbst Bücher und Texte auf Englisch lesen ist ein Ansatz. Es ist und bleibt trotzdem schwer auf Anhieb die passenden Sätze zu formen, wenn man nicht regelmäßig übt. Egal ob mündlich oder schriftlich, eigene Aussagen fallen deutlich schwerer.
Das lässt sich ebenso auf die Software Entwicklung übertragen. Man muss selbst “Hand anlegen” und aktiv werden. Nur so lernt man Programmieren.
Daher also: Theorie ist gut, aber nur begleitend. Man lernt viel mehr durch die Praxis.

3. Keine eigenen Projekte umsetzen
Wer mit Büchern, Videos oder Tutorials arbeitet, findet immer Code-Beispiele.
Wie sonst sollte man konkrete Aspekte einer Programmiersprache erklären? Um ein Gefühl für die Syntax und die Sprache selbst zu entwickeln, ist es sinnvoll den Quellcode abzuschreiben und ihn zu implementieren. Dabei macht man unweigerlich Fehler, an denen man wachsen kann. Aber: Nur Code abtippen reicht nicht aus. Das ist ein ähnliches Problem wie zu viel Zeit mit der Theorie zu verbringen.
Fundierte Programmiererfahrung bekommt man durch eigene Projekte.
Mit einer leeren Datei und nur den eigenen Ideen anzufangen, ist eine komplett andere Sache. Man muss sich über den Aufbau Gedanken machen, Quellcode strukturieren und auch die Software selbst implementieren. Dabei lernt man unendlich viel. Hier passt der Vergleich zu den gesprochenen Sprachen wieder sehr gut: Eine Unterhaltung auf Englisch zu verstehen, ist etwas komplett anderes als diese selbst zu führen.

4. Nicht ausreichende Befassung mit Software-Entwurf und der Architektur
Das Sprachgefühl und die Syntax sind der erste Schritt. Inhaltliches Wissen rund um Methoden, Klassen und der gelieferten Bibliothek sind der zweite.
Die große Kunst bei der Software-Entwicklung ist aber nicht nur eine saubere Implementierung von Methoden. Viel schwieriger ist ein geeigneter Software-Entwurf, der auch später anpassbar ist, übersichtlich strukturiert und auf einer guten Architektur aufbaut. Es ist also wichtig, sich zusätzlich mit der Software-Architektur zu befassen. Das beinhaltet unter anderem auch Aspekte wie Design Patterns.

5. Versuchen mit ein und der selben Sprache alle Probleme lösen zu wollen
Ein häufiger Anfängerfehler, die sich gerade mit der ersten Sprache sicherer fühlen und diese gut beherrschen: Man ist schnell geneigt, alle Probleme mit der Sprache lösen zu wollen. Theoretisch kann man bspw. mit PHP auch Serveranwendungen umsetzen, die im Hintergrund arbeiten. Über die Socket Funktionen kann man bspw. einen Webserver realisieren. Aber nur weil man theoretisch auch eine Schraube mit einem Hammer versenken kann, spricht in der Praxis doch vieles dagegen.
Es ist natürlich nicht falsch zu experimentieren. Auch der Webserver ist sicher ein sehr umfangreiches Projekt, bei dem man sehr viel lernen kann. Zum einen wird man einiges über PHP erfahren. Auf der anderen Seite muss man sich mit dem HTTP-Protokoll befassen. In der Praxis ist jedoch später das Ergebnis mit an Sicherheit grenzender Wahrscheinlichkeit einem Apache-Webserver unterlegen.

6. Zu lange nur mit der gleichen Sprache befassen
Eine Gefahr lauert, wenn man mit einer Sprache erst einmal so richtig “warm geworden ist”. Man kann schnell von dem Weg, sich umfassend auf dem Gebiet der Software-Entwicklung auszubilden, abkommen. Sicher ist es angenehm sich intensiv mit einer Sprache zu befassen, vor allem wenn man erst einmal die Grundlagen beherrscht und nicht mehr ständig die Dokumentation benötigt.

Man landet wieder in der Komfortzone. Unser Tipp: Da muss man schnell wieder raus.
Die durchschnittliche Empfehlung lautet, dass man pro Jahr eine neue Sprache lernen kann. Innerhalb von einem Jahr kann man sich ausreichend mit den unterschiedlichen Aspekten befassen und einige Erfahrung sammeln. Danach sollte man sein Repertoire erweitern.

7. “Nur” mit Scriptsprachen arbeiten
JavaScript, PHP und Co sind wunderbare Sprachen, die für bestimmte Zwecke ein geeignetes Mittel darstellen. Ein vollständiger Programmierer sollte jedoch nicht nur Scriptsprachen kennen, sondern sich auch mit anderen Gebieten auseinander setzen. Das rundet zum einen das Profil ab. Aber auch für die Arbeit mit Scriptsprachen lernt man dazu. Verschiedene Sprachen legen unterschiedlichen Wert auf verschiedene Aspekte. Viel Wissen lässt sich von der einen auf die andere Sprache übertragen. Das Ergebnis kann bessere Software, kürzere Entwicklungszeit oder höhere Software-Qualität sein.
Neben den reinen Scriptsprachen ist es daher mittelfristig gut, sich zusätzlich auch kompilierte Sprachen wie Java oder C/C++ anzuschauen. Zumindest für das eigene Verständnis, ist auch ein Ausflug in die Assembler Welt durchaus sinnvoll.

8. Zu wenig Arbeit mit einem Debugger
Soll ein Fehler nachvollzogen werden, werden im ersten Ansatz häufig die Variablenwerte an unterschiedlichen Stellen betrachtet. Nahe liegt, diese einfach bei der Ausführung ausgeben zu lassen. Das ist jedoch sehr umständlich und manchmal gar nicht möglich. Außerdem lernt man dabei auch nicht so viel.

Statt also System.out.println, echo, print usw. zur Fehlersuche zu benutzen, sollte man sich mit Debugging von Beginn an befassen! Dazu wird direkt im Editor der Programmfluss nachvollzogen. Zur Laufzeit kann man dann an konkreten Stellen die Variablenwerte einsehen und Zeile für Zeile nachvollziehen, was passiert. So lernt man eigene, aber auch fremde Software im Detail kennen.

9. In die falsche Richtung arbeiten
Motivation ist ein ganz entscheidender Faktor. Nur wer nachhaltig am Ball bleibt, kann erfolgreich sein. Das ist so ähnlich wie bei einer Diät: Es gibt realistische und seriöse Ansätze und Ernährungsweisen, die deutlich schneller Ergebnisse ermöglichen. Allerdings ist es gleichzeitig auch schwieriger diese Diäten durchzuhalten. 

Das Problem: Es ist schwerer sich über Wochen und Monate komplett daran zu halten. Eine etwas weniger effektive Methode ist besser, wenn man dabei ausreichend motiviert bleibt.
So ist es bei der Entwicklung auch! Grundlagen und Hintergrundwissen sind toll. Ein vollständiger Programmierer sollte sich mit der Technologie auskennen.
Es bringt im Alltag einem Webentwickler allerdings wenig, wenn er sich deshalb ein Jahr lang mit Assembler befasst. Davon hat er noch nicht einmal an seinem Traum gearbeitet, eine Sprache lernen mit der er Software für das Web schreiben kann.
Gleiches gilt für andere Bereiche ebenso: Warum erst C/C++, HTML, JavaScript oder Python lernen, wenn man eigentlich Android Apps entwickeln möchte? Hier empfiehlt sich der Einstieg in Java. Das macht viel mehr Spaß.
Bei aller Liebe zu Hintergründen und Grundlagenwissen, sollte man das Ziel also nicht aus den Augen verlieren.

10. Keine Arbeit mit automatisierten Tests
Software muss getestet werden. Da führt kein Weg dran vorbei. Wenn es sich um kleinere Projekte handelt, ist das auch gar kein Problem. Man kann die wenigen Funktionen überblicken und manuell testen. Wird die Software allerdings nur etwas größer und umfangreicher, kann man nicht mehr alle Aspekte berücksichtigen.
Ein häufiger Fehler ist, sich mit Unit-Testing und Test-Driven-Development erst viel zu spät zu befassen. Das wird gern als etwas gesehen, was man als einzelner Entwickler nicht braucht. Als etwas, dass in Unternehmen interessant ist. Aber, Software-Qualität hat mehrere Facetten. Zum einen wird natürlich wirklich jede Methode, Funktion und Logik getestet. Man weiß also auch nach Änderungen, ob es Probleme gibt. Dabei werden vor allen Dingen Seiteneffekte abgefangen, die sich auf unerwartete Stellen im Quellcode auswirken können. Zudem lernt man aber auch, sich bei seiner Logik auf das Minimum zu beschränken. Man muss sich mit dem eigenen Code noch einmal genau befassen, um ihn mit Tests abzudecken. Das ist sehr lehrreich.
Daher also: Unit-Testing ist unbedingt auch etwas ganz am Anfang der Karriere.
Wenn man mit der eigenen Sprache sicherer wird, kann und sollte man ruhig mal einen Blick in diese Welt riskieren!

11. Verzicht auf Versionsverwaltung 
Versionsverwaltung mittels Git ist toll.
Das gilt bei den ersten Projekten ebenso wie später, wenn mehr Routine vorhanden ist. Speziell am Anfang kann man einfach mal einen Stand “einfrieren” und mutig ausprobieren. Wenn es nicht klappt, rudert man mit nur einem Befehl wieder zum alten Stand zurück! Das bedeutet, dass alle Änderungen in Dateien rückgängig gemacht werden können.
Außerdem protokolliert man seine Änderungen gleichzeitig. Das ist von unschätzbarem Wert.

12. Zu früh aufgeben bzw. nicht am Ball bleiben!
Eines darf man in jedem Fall nicht machen: Aufgeben! Nur wer am Ball bleibt, schafft es. Dabei ist das eigentlich gar nicht so schwer! Man sollte nicht übertrieben an die Sache heran gehen! Vielleicht einfach als Ziel setzen, sich zweimal die Woche eine Viertelstunde Zeit zu nehmen. Bei Interesse darf es auch mehr werden, aber die zwei Mal 15 Minuten sind Pflicht. Daraus entsteht eine Angewohnheit, die sich automatisch ausbaut. Versprochen!
Neben der eigenen Disziplin ist auch die mächtige Wirkung der ganzen Materialen ein Aspekt. Schaut man sich die Software-Welt heute an, wirkt alles schnell sehr überwältigend. Es gibt eine Menge Programmiersprachen, viele Teilbereiche und immer neue Technologien. Genug, um sich ein Leben lang nur mit dem Lernen zu befassen.
Programmieren lernt man nicht von heute auf morgen. Es ist kein Sprint, viel mehr ein Marathon. Eigentlich ist es sogar eine lebenslange Reise, da es immer etwas zu entdecken gibt.

2015年9月3日星期四

An application to search playgrounds for children


     I released first lifestyle application the Playgrounds App which can search kids playgrounds.

     The Content data is provided by http://spielplatz-radar.de/ that affords grounds from 46´000 in Germany,  2´800 in Austria, 1´900 Switzerland and 91´000 worldwide.
    
     The development duration is less than one month and I've contacted a lot other providers who might provide localized data.  The problem of the origin source http://spielplatz-radar.de/ is about accuracy location of grounds.  I welcome localized organization who can provide exact data of playgrounds and I'll integrate data into the App as soon as possible.  Download the application:



     App is now opensource and can be cloned from GitHub.

2015年7月10日星期五

Hacker(News)-Push 2.0

After a hack-event that crashed the backend, I decided to remake the application from backend-level to front-end(Actually I really have a plan to remake the app).


Download: Remake version of Hacker-Push App with enhance of material-design and new backend.



What new supported are:

1. Topic-messages of GCM.
2. Float-Action-Button new design(Coordinate-Layout, AppBarLayout etc).
3. Add Android's design-library for material-design(excl. FAB).
4. New crashlytics(fabric).





2015年7月1日星期三

程序师 joined --IT Daily News 1.2--

IT Daily News released 1.2.
New version including now RSS via 


IT Daily News downloads


Also aApp-backend, SDK of TopFeeds4J have been updated for new data-source.

Source of IT Daily News: https://github.com/XinyueZ/top-feeds
SDK: https://github.com/XinyueZ/top-feeds-client/tree/master/TopFeeds4J

2015年6月28日星期日

Released two applications a few hours ago

    It was amazing that I released two applications of Android in just 72 hours, even an update was included after short uploading. 

    Take three weeks night and weekends affords the WhatsUp News has been completed v1.0(lately was v1.0.1).  The features including push and news-feeds parsing from faroo.com  lead the application to be unique among trees of apps in the play-store.  Of cos the backend is complete GAE by Golang and supports Google Cloud Message with topics-messages which has been announced a few days ago at Google dev-party I/O. With the new message feature I don't have to make a database local(on GAE side) to store all clients' push-tokens. Only to work is to define different topic-names and all clients only to register for these names, the rest jobs are on hang to Google, it is really cool that clients can save a lot net-traffics after submitting a push-tokens and unregister it.

   Notice: A version 1.0.2 will be submitted to store as soon as possible for a hot bug-fix associating to https://code.google.com/p/android/issues/detail?id=175069

Here is link to store:

    A second application is marsTemp which provides a list of weather condition on mars. Of cos I can not get data from machine on it directly :). Ok, it is feeds from {MAAS} which converts data from NASA.  The application demos how to use Google's design library and to continue to load data functions when application-list moving to bottom.

Here is link to store:



2015年5月18日星期一

I released a new free IT-Books App for public available.

Recent night I published a new version of IT-Books.

The new version including more feelings of Google's material-design supports new API  to let us download books directly instead of a WebView or opening external browsers.

Use Retrofit as http-client which enhances ability to internet connections.

The new API is wrapper of a external SOAP into readable JSON, more info to new API can be found here.  The new version use this API that is hosted in GAE. Of cos you can check it out and fork to your own cloud. Because of it we discard using http://it-ebooks.info/, but thanks .

Also what new of this version is that the app save bookmarks in cloud what previous versions only for local. Users can keep they permanently, thanks to a Chinese backend here to simplify my works..

In order to get more info can be found in store.

2015年4月28日星期二

Split a sub-project from it-books to support download books directly.

Download-list of IT-Books you search.

The API is still in sandbox.

Support feature to download a book directly and search books independently from http://it-ebooks.info/

Find project detail.

2015年4月14日星期二

API update

I update API of TopFeeds and its SDK TopFeeds4J.  The example App in PlayStore is also updated. The new function is to bookmark news-entry and store on backend.

About API TopFeeds:
An API to collect daily IT news in Chinese from CSDN and oschina.net


2015年4月7日星期二

I release next web API: Get top-feeds about IT news in Chinese language.

Just a smart idea to solve some questions of friends from valley who develop community application to Chinese market.

We don't discuss more and just doing. So it comes out.

Data-source are CSDN and OSCHINA which are two largest Chinese IT developer communities.

Fetch RSS from CSDN.

Use internal API of OSCHINA.

API: https://github.com/XinyueZ/top-feeds/blob/master/README.md

SDK inc. an example App from store:
https://github.com/XinyueZ/top-feeds/blob/master/README.md#sdk

(The sample application must being pended before Google allows it to be visible.)




2015年3月20日星期五

If I'm hiring people....

Nothing is interesting and nothing is boring.

I've some friends that come from valley , they are HRs or chef of tech in their company.  They told some stories about hiring people and tech me how to hire some right ones. They agree that just an interview brings nothing, a direct view on the GitHub might be best way to know how the developer think and work.

I know, it is difficult , but right! I agree as well.


2015年3月9日星期一

A solution to scrolling-problem when the ScrollView mix with ScrollView or RecycleView or ListView etc.

Recently I face a problem , a classical problem that a ScrollView(parent-scrollview) contains some other scrollable objects(child-view) like ScrollView, ListView even a RecycleView.

The problem has two cases.

1. The height of child-view. There're some solutions to solve it. But I don't wanna it, because I need a fixed size of child-view, let me define 250-dp.

2. The child-view can't be scrolled when it's beenn contained inside parent-scrollview. There're many codes to eliminate this problem. But they do not work for me, because all the posts are cases like a parent-parent-scrollview contains child-view directly.

Ok My case is complex.

A parent-scrollview contains a ViewPager and each page has a fragment with RecycleView.  :)

The RecycleView can't be scrolled.



Solved: here.


2015年3月2日星期一

Publish a long time developed application.

I release the app SchautUp which provides functionalities to run scheduled tasks automatically. It's been longtime developed more than half year.

I cut a lot internal methods and amount of functions were also killed down before being launched.

I don't know whether to support this tool in the future :).

Try and test the application from store.

2015年2月26日星期四

2015年2月20日星期五

Update wrapper API to www.oschina.net, friends-list added.

New API for getting all friends including my-fans, and users who have focused on me.

Also update Android sample osc-tweet to show the friends-list.

Now rename the java-library of osc-server to osc4j. However the java-lib is still under sample project for future more features.

Checkout friends-list API here.

More info.

2015年2月13日星期五

Publish APIs for www.oschina.net

I really don't like the model of OAuth2 of oschina,  not only that they don't provide client libraries, but also if you wanna be granted an access-token, you must be redirected to a web-app which you're forced to give as you register on oschina for using its own openAPI.   That means, no web-app no Access-Token.

Then what happens if you wanna dev a client application like Android , Windows, Linux etc?

So start to wrapping openAPI and bypass the webview or browser.

There's a very long list of all available interfaces,  It's really a hard job.

Current release is showing all tweets, my-tweets, and all hotspot tweets.

A parallel java library is also in progress.

Checkout.