Posts

Showing posts from November, 2014

How to configure Samba Server in Ubuntu?

How to configure Samba Server in Ubuntu? Table of Contents What is Samba? Target Prepare configure /etc/samba/smb.conf 1 What is Samba? Samba is a linux implementation of file share and transaction protocol for LAN, which mainly used in Windows OS. Samba is more convenient than FTP in my opinion, and it is useful in a small group who works in a same LAN, but its members are familiar with different OS, Bob works in Mac, David works in Ubuntu, while Mars likes Windows more. 2  Target This tutorial is a step to step document of how to build a Samba Server which met the following requirement: Share a Directory with both readable and writable authority for Guest. Share a Directory with both readable and writable authority for certain Users. Share a Directory with only readable authority for Guest. 3 Prepare addgroup smbgrp adduser abc smbgrp smbpasswd -a abc mkdir /xxx/path chown -R abc:smbgrp /xxx/path mkdir /xxx/public chown -R nobody:nogroup /xx

How to configure Android project's build types in Gradle?

Image
How to configure Android project's build types in Gradle? Table of Contents Generate Java Constants Generate Android resources A few days ago, our team needs to configure the Gradle's build scripts to auto build the project. Here is the requirement, to build three versions of app, release, development and test, from the command line. I found the ways from the following link, http://stackoverflow.com/questions/17197636/is-it-possible-to-declare-a-variable-in-gradle-usable-in-java Actually, we can generate the Java constants and Android resources from the Gradle's build script: 1 Generate Java Constants android { buildTypes { debug { buildConfigField "int" , "FOO" , "42" buildConfigField "String" , "FOO_STRING" , "\"foo\"" } release { buildConfigField "int" , "FOO" , "52"

My Android JNI Tutorial

Image
My Android JNI Tutorial Since I worked for my current employer, I found out my passion of writing was dropping down dramatically. My salary was raised and also got a promotion, but my ambition for the software looks have not evolved. So what is my favorite? coding and writing. I should keep that in my mind. I reviewed what I did in the last few months, there are one thing suit my desire of writing. I wrote a JNI module to process the jbig compressed image, both decoding and encoding, actually I initially allocated this job to one of my former colleague, but it looks so sucks, then I have to refactor his code after his resignation, basically rewrote the code. This is my first time to wrote JNI code with android-ndk, also my former jobs included a few JNI tasks, but it is in android system development not as an app developer. Here are my experience and summary of JNI coding. 1. How to design JNI code? Load the sharable library in static code in java part.     static