Monday, 26 September 2016

How to install Android Studio on Ubuntu



  1. Download Android-Studio [Download]
  2. Extract downloaded folder
  3. Copy folder into home directory
  4. Open terminal (press: ctrl + alt +t)
  5. Type following commands:
  6. cd android-studio/bin [Enter]
  7. ./studio.sh [Enter]

Inforoid - Information about Android





1- How to find SHA1 key?

Method 1:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android 

write above line in android studio terminal and press enter

Method 2:
If you are using android studio use simple step

  1. Run your project
  2. Click on Gradle menu
  3. Expand Gradle task tree
  4. Click on android -> signingReport and see the magic
  5. It will tell you everything
_______________________________________________________________________


2- Prerequisite for Android studio 2.1.2: 

JDK  version > 1.8
Set JDK path to 1.8: Project structure
Set Android SDK path: Project Structure

_______________________________________________________________________

3- Useful shortcut keys android studio:

Alt + insert ==> Generate options
ctrl + O ==> Override method
ctrl + win + alt + l ==> indentation of XML file
ctrl + / ==> Comment

_______________________________________________________________________

4- What is instant run?

With Instant Run, you can push changes to methods and existing app resources to a running app without building a new APK, so code changes are visible almost instantly.

_______________________________________________________________________

5- AVD stand for?

Android Virtual Device

_______________________________________________________________________

6- ID naming conventions XML:

button_save_<activity_or_layout_name>
button_cancel_<activity_or_layout_name>

_______________________________________________________________________

7- Online json editor:

http://www.jsoneditoronline.org/

_______________________________________________________________________

8- Splash Screen Android:

Android splash screen are normally used to show user some kind of progress before the app loads completely.

_______________________________________________________________________

9- WebView:

WebView to display HTML pages.

_______________________________________________________________________

10- SQLiteDatabase Path: 

/data/data/<Package-Name>/databases/<DB-Name>.db

_______________________________________________________________________

11- What is Application Class in Android?

Introduction:
If we consider an apk file in our mobile, it is comprised of multiple useful blocks such as, Activities, Services and others.
These components do not communicate with each other regularly and not forget they have their own life cycle. Which indicate that they may be active at one time and inactive the other moment.

Requirements:
Sometimes we may require a scenario where we need to access a variable and its states across the entire Application regardless of the Activity the user is using, example is a user might need to access a variable that holds his personnel information like name that has to be accessed across the Application, we can use SQLite but creating a Cursor and closing it again and again is not good on performance, we could use Intents to pass the data but its clumsy and activity itself may not exist at a certain scenario depending on the memory-availability.

Uses of Application Class:
Access to variables across the Application, you can use the Application to start certain things like analytics etc. since the application class is started before Activities or Services are being run,
there is a overridden method called onConfiguration() changed that is triggered when the application configuration is changed (horizontal to vertical & vice-versa), there is also a event called onLowMemory() that is triggered when the Android device is low on memory.

_______________________________________________________________________

12- Conversion of Eclipse project into Android Studio project: 

1) Open eclipse project folder
2) Open Project.properties file and remove last line
3) Open android studio and import eclipse project
4) Change app gradle and project gradle
5) Change Manifest (app tag, main tag)
6) Import module if any
7) Module path in app gradle

_______________________________________________________________________

13- Dropbox chooser API:

https://www.dropbox.com/developers/chooser#android

_______________________________________________________________________

14- Google Drive chooser API:

API:http://www.101apps.co.za/index.php/articles/android-apps-and-google-drive-a-tutorial.html

_______________________________________________________________________

15- GCM: Google Cloud Messaging

Send data from your server to your users' devices, and receive messages from devices on the same connection. The GCM service handles all aspects of queuing of messages and delivery to client applications running on target devices, and it is completely free.

Push messages from your back-end servers to tell your apps that there's new content for the user, or other data to sync.

FCM: Firebase cloud messaging (Updated form of GCM)

_______________________________________________________________________

16- Volley:

It integrates easily with any protocol and comes out of the box with support for raw strings, images, and JSON.
Volley is not suitable for large download or streaming operations, since Volley holds all responses in memory during parsing. For large download operations, consider using an alternative like DownloadManager.

By default all the volley network calls works asynchronously, so we don’t have to worry about using asynctask anymore.

_______________________________________________________________________

17- android:layout_padding vs android:layout_margin:

android:layout_margin:
Space outside the view between itself and its container is called margin.

android:layout_padding:

Space inside the view between its boundaries and content is called padding.

__________________________________________________________________________

18- Google Analytics integration in android app:

Google Analytics integration in android app:
https://developers.google.com/analytics/devguides/collection/android/v4/ 

Interview Questions - Asked by different companies


TechnoSoft Solutions



  1. FYP
  2. WCF services
  3. How to secure WCF?
  4. What is Web services?
  5. Abstract classes and interfaces (if we have 4 abstract methods. what is good? why we need two different approach. If I don't need multiple inheritance)
  6. Abstraction (How it difference from C string library. In which we also call methods)
  7. Difference between abstraction and encapsulation?
  8. HTML table code (first columns were merge)
  9. Find sum of max and second max in an array?
  10. Join (inner or outer)
  11. How garbage collector call and works?
  12. Session handling in back-end
  13. Strong points of yours
  14. Weak points of yours
  15. .net latest versions (.net, mvc, asp)
  16. Unsafe code?
  17. CLR
  18. JIT
  19. data types in C#
  20. difference between primitive and reference type
  21. float size
  22. decimal size
  23. yield keyword in C#
  24. usafe code in C#
  25. how to prevent class for inherit further
  26. LINQ query
  27. WCF services
  28. array sort method use which algorithm
  29. Data validation through data annotation
  30. how to apply password match data annotation
  31. Asyncronious call
  32. data annotaion library name
  33. Linq query for joins
  34. IEnumeriable and Iqueryable
  35. Task class in C#
  36. viewBag, ViewData, TempData
  37. LifeCycle of tempData
  38. seed in entity framework
  39. join (left or right)
  40. code first approach function name
  41. jQuery selector
  42. two linked list intersect each other find point of intersection
  43. find loop in linked list
  44. 31 * 29 in mind
  45. a frog fell into well, well has 30 stairs. He daily climb 4 stairs and fall 3 stairs. How many days he came out of well
  46. Lahore to Karachi 20 telephone exchange one telephone exchange is damage find damage telephone exchange
  47. can wcf service have different type of end points
  48. in a from if the student select he is graduating than institute field become required through data annotation?
  49. database schema(folder has folders + files and so on)
__________________________________________________________________________

Northbay Solutions



  1. encapsulation
  2. Composition & Aggregation ?
  3. abstraction
  4. abstract classes vs interfaces
  5. can we use access identifier in interface?
  6. overloading and overriding
  7. there is another overloading which is? (operator overloading)
  8. what is operator overloading?
  9. deep copy/shallow copy
  10. when content of an object change in deep copy does other also change?
  11. All sorting algorithms & When to use which ?
  12. Best sorting algorithm?
  13. time complexity of best case of bubble sort?
  14. which sorting algo is best in average case?
  15. what is meant by space complexity?
  16. database optimization (how many steps? usually we go through how many steps?)
  17. advantages and disadvantages of normalization?
  18. relational algebra in db?
  19. Context Switching?
  20. paging
  21. deadlock conditions
  22. two ropes problem. one rope burn in 60 minutes calculate 45 minutes from 2 ropes?
  23. Divide cube into 8 pieces with 3 cuts?
  24. produce 0,1,2,3,4,5,6,7 from rand5() function. each number should have equal probability?
  25. input: My name is Furqan.
  26. output: Furqan is name my.  (write program)
  27. FYP
__________________________________________________________________________

Rolustech Dynamic IT Solution


  1. composition vs aggregation vs association 
  2. static binding, dynamic binding
  3. overloading, overriding
  4. static variable
  5. abstract classes vs interfaces
  6. what is necessary for a class who implements interface 
  7. swap two variables without using anyother variable
  8. find second maximum from an array
  9. database join query
  10. Android:
  11. FYP
  12. activity vs fragment
  13. list View
  14. adapter
  15. layouts
  16. web services
  17. intent