Primary Lesson 8: Starting an Activity Unlike other programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle. There is a sequence of callback methods that start up an activity and a sequence...
Primary Preprocessor Directives - C Programming The C preprocessor is a macro processor that is used automatically by the C compiler to transform your program before actual compilation (Proprocessor direcives are executed before compilation.). It is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs. A macro...
Primary Lesson 7: Supporting Different Platform Versions While the latest versions of Android often provide great APIs for your app, you should continue to support older versions of Android until more devices get updated. This lesson shows you how to take advantage of the latest APIs while continuing to support older versions as well. The dashboard for...
Primary Lesson 6: Supporting Different Screens Android categorizes device screens using two general properties: size and density. You should expect that your app will be installed on devices with screens that range in both size and density. As such, you should include some alternative resources that optimize your app’s appearance for different screen sizes and...
Primary Lesson 5: Supporting Different Languages It’s always a good practice to extract UI strings from your app code and keep them in an external file. Android makes this easy with a resources directory in each Android project. If you created your project using the Android SDK Tools (read Creating an Android Project), the tools...
Programming Puzzles C Program to print "hello world" without semicolon - Programming Puzzles We can print "hello world" or anything else in C without using semicolon. There are various ways to do so: 1. Using if 2. Using switch 3. Using while loop etc. 1. Using if Let's see a simple c example to print "hello world"...
Wiki C/C++ Compiler (gcc) for Android - Run C/C++ programs on Android C4droid is a user-friendly (but powerful) C/C++ IDE + C/C++ compiler for Android. Basic features of C4droid: * Offline C compiler: create your own applications on Android device and run them even without Internet access * Source code editor with syntax highlighting, tabs, code completion, code formatting, file association and undo/...
Programming Puzzles C Program without main() function - Programming Puzzles We can write c program without using main() function. To do so, we need to use #define preprocessor directive. The C preprocessor is a micro processor that is used by compiler to transform your code before compilation. It is called micro preprocessor because it allows us to add macros. A...
Programming Puzzles Find Anagram String - Programming Puzzles Given two strings, work out if they both have exactly the same characters in them. Example Input word, wrdo This returns true because they are the same but just scrambled. Input word, wwro This returns false. Rules Here are the rules! * Assume input will be at least 1 char long,...
Programming Puzzles Best golfing (tips and tricks) in C - Programming Puzzles What general tips do you have for golfing(tips and tricks) in C? 1. Use bitwise XOR or - minus sign to check for inequality between integers: * if(a^b) instead of if(a!=b) save 1 character. * if(a-b) instead of if(a!=b) also save 1 character. --------------------------------------------------------------------------------...