Saturday, 10 December 2016

dos and don'ts of writing c++ code

  1. Use namespaces - when you have huge code and classes, add them into a name spaces by categorizing them. Like a namespace for database, namespace for logger, namespace for ui etc. 
  2. Follow C++ coding conventions and remain consistent in project and with team ( and with global c++ community).
  3. In header files, avoid the use of forward declaration as much as possible and included the required header files.

Wednesday, 7 December 2016

Android create apk release with date

#
# script to create a release for apk with current date time
#

PROJECT="SpeedRiderApp"
DATE=`date +%Y-%m-%d`

echo "Preparing APK For ${PROJECT}"
echo "Removing previous releases of date: ${DATE}"

rm -fr "${HOME}/Desktop/${PROJECT}-${DATE}.apk" "${HOME}/Desktop/${PROJECT}-${DATE}" "${HOME}/Desktop/${PROJECT}-${DATE}.zip"

cp "app/build/outputs/apk/app-debug.apk"  "${HOME}/Desktop/${PROJECT}-${DATE}.apk"

echo "----- DONE MAKING APK -----"


cp -a . "${HOME}/Desktop/${PROJECT}-${DATE}"
cd "${HOME}/Desktop/${PROJECT}-${DATE}"

echo "Removing build"
rm -fr build

echo "Removing app/build"
rm -fr "app/build"

cd "${HOME}/Desktop/"
zip -r "${PROJECT}-${DATE}.zip" "${PROJECT}-${DATE}"

# back to project dir
cd -