archive-com.com » COM » T » TECHOTOPIA.COM

Total: 1018

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Android Studio Development Essentials - Android 6 Edition - Techotopia
    Creating the Navigation Drawer Template Project The Template Layout Resource Files The Header Coloring Resource File The Template Menu Resource File The Template Code Running the App An Android Studio Master Detail Flow Tutorial The Master Detail Flow Creating a Master Detail Flow Activity The Anatomy of the Master Detail Flow Template Modifying the Master Detail Flow Template Changing the Content Model Changing the Detail Pane Modifying the WebsiteDetailFragment Class Modifying the WebsiteListActivity Class Adding Manifest Permissions Running the Application An Overview of Android 6 Intents An Overview of Intents Explicit Intents Returning Data from an Activity Implicit Intents Using Intent Filters Checking Intent Availability Android 6 Explicit Intents A Worked Example Creating the Explicit Intent Example Application Designing the User Interface Layout for ActivityA Creating the Second Activity Class Designing the User Interface Layout for ActivityB Reviewing the Application Manifest File Creating the Intent Extracting Intent Data Launching ActivityB as a Sub Activity Returning Data from a Sub Activity Testing the Application Android 6 Implicit Intents A Worked Example Creating the Android Studio Implicit Intent Example Project Designing the User Interface Creating the Implicit Intent Adding a Second Matching Activity Adding the Web View to the UI Obtaining the Intent URL Modifying the MyWebView Project Manifest File Installing the MyWebView Package on a Device Testing the Application Android 6 Broadcast Intents and Broadcast Receivers An Overview of Broadcast Intents An Overview of Broadcast Receivers Obtaining Results from a Broadcast Sticky Broadcast Intents The Broadcast Intent Example Creating the Example Application Creating and Sending the Broadcast Intent Creating the Broadcast Receiver Configuring a Broadcast Receiver in the Manifest File Testing the Broadcast Example Listening for System Broadcasts A Basic Overview of Java Threads and Thread Handlers on Android An Overview of Threads The Application Main Thread Thread Handlers A Basic Threading Example Creating a New Thread Implementing a Thread Handler Passing a Message to the Handler An Overview of Android 6 Started and Bound Services Started Services Intent Service Bound Service The Anatomy of a Service Controlling Destroyed Service Restart Options Declaring a Service in the Manifest File Starting a Service Running on System Startup Implementing an Android 6 Started Service A Worked Example Creating the Example Project Creating the Service Class Adding the Service to the Manifest File Starting the Service Testing the IntentService Example Using the Service Class Creating the New Service Modifying the User Interface Running the Application Creating a New Thread for Service Tasks Android 6 Local Bound Services A Worked Example Understanding Bound Services Bound Service Interaction Options An Android Studio Local Bound Service Example Adding a Bound Service to the Project Implementing the Binder Binding the Client to the Service Completing the Example Testing the Application Android 6 Remote Bound Services A Worked Example Client to Remote Service Communication Creating the Example Application Designing the User Interface Implementing the Remote Bound Service Configuring a Remote Service in the Manifest File Launching and Binding to the Remote Service Sending a Message to the Remote Service

    Original URL path: http://www.techotopia.com/index.php?title=Android_Studio_Development_Essentials_-_Android_6_Edition&mobileaction=toggle_view_mobile (2016-02-13)
    Open archived version from archive


  • Start Here iOS 9 - Techotopia
    detail including new error handling in Swift 2 designing Stack View based user interfaces multiple storyboard support iPad multitasking map flyover support 3D Touch and Picture in Picture media playback The aim of this book therefore is to teach you the skills necessary to build your own apps for iOS 9 Assuming you are ready to download the iOS 9 SDK and Xcode 7 have an Intel based Mac and ideas for some apps to develop you are ready to get started For iOS 8 Developers If you have already read the iOS 8 edition of this book or have experience with the iOS 8 SDK then you might prefer to go directly to the new chapters in this iOS 9 edition of the book All chapters have been updated to reflect the changes and features introduced as part of iOS 9 Swift 2 and Xcode 7 Chapters included in this edition that were not contained in the previous edition or have been significantly rewritten for iOS 9 and Xcode 7 are as follows An Introduction to Xcode 7 Playgrounds Joining the Apple Developer Program An Introduction to Swift Subclassing and Extensions Understanding Error Handling in Swift 2 Organizing Scenes over Multiple Xcode Storyboard Files Working with the iOS 9 Stack View Class An iOS 9 Stack View Tutorial A Guide to Multitasking in iOS 9 An iOS 9 Multitasking Example An iOS 9 3D Touch Force Handling Tutorial An iOS 9 3D Touch Quick Actions Tutorial An iOS 9 3D Touch Peek and Pop Tutorial An iOS 9 MapKit Flyover Tutorial An iOS 9 Multitasking Picture in Picture Tutorial eBookFrenzy com Purchase the full edition of this iOS 9 App Development Essentials book in eBook 12 99 or Print 39 99 format iOS 9 App Development Essentials Print and

    Original URL path: http://www.techotopia.com/index.php/Start_Here_iOS_9 (2016-02-13)
    Open archived version from archive

  • Joining the Apple Developer Program - Techotopia
    Purchasing can only be enabled and tested with Apple Developer Program membership Of further significance is the fact that Apple Developer Program members have access to technical support from Apple s iOS support engineers though the annual fee initially covers the submission of only two support incident reports more can be purchased and membership of the Apple Developer forums which can be an invaluable resource for obtaining assistance and guidance from other iOS developers and for finding solutions to problems that others have encountered and subsequently resolved Program membership also provides early access to the pre release Beta versions of both Xcode and iOS eBookFrenzy com Purchase the full edition of this iOS 9 App Development Essentials book in eBook 12 99 or Print 39 99 format iOS 9 App Development Essentials Print and eBook ePub PDF Kindle edition contains 105 chapters By far the most important aspect of the Apple Developer Program is that membership is a mandatory requirement in order to publish an application for sale or download in the App Store Clearly program membership is going to be required at some point before your application reaches the App Store The only question remaining is when exactly to sign up When to Enroll in the Apple Developer Program Clearly there are many benefits to Apple Developer Program membership and eventually membership will be necessary to begin selling applications As to whether or not to pay the enrollment fee now or later will depend on individual circumstances If you are still in the early stages of learning to develop iOS applications or have yet to come up with a compelling idea for an application to develop then much of what you need is provided without program membership As your skill level increases and your ideas for applications to develop take shape you can after all always enroll in the developer program at a later date If on the other hand you are confident that you will reach the stage of having an application ready to publish or know that you will need access to more advanced features such as iCloud In App Purchasing and Apple Pay then it is worth joining the developer program sooner rather than later Enrolling in the Apple Developer Program If your goal is to develop iOS applications for your employer then it is first worth checking whether the company already has membership That being the case contact the program administrator in your company and ask them to send you an invitation from within the Apple Developer Program Member Center to join the team Once they have done so Apple will send you an email entitled You Have Been Invited to Join an Apple Developer Program containing a link to activate your membership If you or your company is not already a program member you can enroll online at https developer apple com programs enroll Apple provides enrollment options for businesses and individuals To enroll as an individual you will need to provide credit card

    Original URL path: http://www.techotopia.com/index.php/Joining_the_Apple_Developer_Program (2016-02-13)
    Open archived version from archive

  • Installing Xcode 7 and the iOS 9 SDK - Techotopia
    Mac OS X running on the system be version 10 10 4 or later If the About This Mac dialog does not indicate that Mac OS X 10 10 4 or later is running click on the Software Update button to download and install the appropriate operating system upgrades Figure 3 1 eBookFrenzy com Purchase the full edition of this iOS 9 App Development Essentials book in eBook 12 99 or Print 39 99 format iOS 9 App Development Essentials Print and eBook ePub PDF Kindle edition contains 105 chapters Installing Xcode 7 and the iOS 9 SDK The best way to obtain the latest versions of Xcode and the iOS SDK is to download them from the Apple Mac App Store Launch the App Store on your Mac OS X system enter Xcode into the search box and click on the Free button to initiate the installation Starting Xcode Having successfully installed the SDK and Xcode the next step is to launch it so that we can create a sample iOS 9 application To start up Xcode open the Finder and search for Xcode Since you will be making frequent use of this tool take this opportunity to drag and drop it into your dock for easier access in the future Click on the Xcode icon in the dock to launch the tool The first time Xcode runs you may be prompted to install additional components Follow these steps entering your username and password when prompted to do so Once Xcode has loaded and assuming this is the first time you have used Xcode on this system you will be presented with the Welcome screen from which you are ready to proceed Figure 3 2 Adding Your Apple ID to the Xcode Preferences Regardless of whether or not you

    Original URL path: http://www.techotopia.com/index.php/Installing_Xcode_7_and_the_iOS_9_SDK (2016-02-13)
    Open archived version from archive

  • A Guided Tour of Xcode 7 - Techotopia
    that file will appear in the center panel where it may then be edited To open the file in a separate editing window simply double click on the file in the list Creating the iOS App User Interface Simply by the very nature of the environment in which they run iOS apps are typically visually oriented As such a key component of just about any app involves a user interface through which the user will interact with the application and in turn receive feedback Whilst it is possible to develop user interfaces by writing code to create and position items on the screen this is a complex and error prone process In recognition of this Apple provides a tool called Interface Builder which allows a user interface to be visually constructed by dragging and dropping components onto a canvas and setting properties to configure the appearance and behavior of those components As mentioned in the preceding section Xcode pre created a number of files for our project one of which has a storyboard filename extension This is an Interface Builder storyboard save file and the file we are interested in for our HelloWorld project is named Main storyboard To load this file into Interface Builder simply select the file name in the list in the left hand panel Interface Builder will subsequently appear in the center panel as shown in Figure 4 5 Figure 4 5 In the center panel a visual representation of the user interface of the application is displayed Initially this consists solely of the UIView object This UIView object was added to our design by Xcode when we selected the Single View Application option during the project creation phase We will construct the user interface for our HelloWorld app by dragging and dropping user interface objects onto this UIView object Designing a user interface consists primarily of dragging and dropping visual components onto the canvas and setting a range of properties In order to access objects and property settings it is necessary to display the Xcode right hand panel if it is not already displayed This panel is referred to as the Utilities panel and can be displayed by selecting the right hand button in the right hand section of the Xcode toolbar Figure 4 6 The Utilities panel once displayed will appear as illustrated in Figure 4 7 Figure 4 7 Along the top edge of the panel is a row of buttons which change the settings displayed in the upper half of the panel By default the File Inspector is displayed Options are also provided to display quick help the Identity Inspector Attributes Inspector Size Inspector and Connections Inspector Before proceeding take some time to review each of these selections to gain some familiarity with the configuration options each provides Throughout the remainder of this book extensive use of these inspectors will be made The lower section of the panel may default to displaying the file template library Above this panel is another toolbar containing buttons to display other categories Options include frequently used code snippets to save on typing when writing code the Object Library and the Media Library For the purposes of this tutorial we need to display the Object Library so click on the appropriate toolbar button represented by the circle with a small square in the center This will display the UI components that can be used to construct our user interface Move the cursor to the line above the lower toolbar and click and drag to increase the amount of space available for the library if required The layout of the items in the library may also be switched from a single column of objects with descriptions to multiple columns without descriptions by clicking on the button located in the bottom left hand corner of the panel and to the left of the search box Changing Component Properties With the property panel for the View selected in the main panel we will begin our design work by changing the background color of this view Start by making sure the View is selected and that the Attributes Inspector View Utilities Show Attributes Inspector is displayed in the Utilities panel Click on the white rectangle next to the Background label to invoke the Colors dialog Using the color selection tool choose a visually pleasing color and close the dialog You will now notice that the view window has changed from white to the new color selection Adding Objects to the User Interface The next step is to add a Label object to our view To achieve this either scroll down the list of objects in the Object Library panel to locate the Label object or as illustrated in Figure 4 8 enter Label into the search box beneath the panel Figure 4 8 Having located the Label object click on it and drag it to the center of the view so that the vertical and horizontal center guidelines appear Once it is in position release the mouse button to drop it at that location We have now added an instance of the UILabel class to the scene Cancel the Object Library search by clicking on the x button on the right hand edge of the search field Select the newly added label and stretch it horizontally so that it is approximately three times the current width With the Label still selected click on the centered alignment button in the Attributes Inspector View Utilities Show Attributes Inspector to center the text in the middle of the label view Figure 4 9 Double click on the text in the label that currently reads Label and type in Hello World Locate the font setting property in the Attributes Inspector panel and click on the T button next to the font name to display the font selection menu Change the Font setting from System System to Custom and choose a larger font setting for example a Georgia bold typeface with a size of 24 as

    Original URL path: http://www.techotopia.com/index.php/A_Guided_Tour_of_Xcode_7 (2016-02-13)
    Open archived version from archive

  • An Introduction to Xcode 7 Playgrounds - Techotopia
    content is added it is said to be displayed in raw markup format To display in rendered markup format select the Editor Show Rendered Markup menu option Once rendered the above rich text should appear as illustrated in Figure 5 9 Figure 5 9 Detailed information about the Markdown syntax can be found online at the following URL https developer apple com library ios documentation Swift Reference Playground Ref Chapters MarkupReference html Working with Playground Pages A playground can consist of multiple pages with each page containing its own code resources and rich text comments So far the playground used in this chapter contains a single page Add an additional page to the playground now by selecting the File New Playground Page menu option Once added click on the left most of the three view buttons marked C in Figure 5 1 to display the Navigator panel Note that two pages are now listed in the Navigator named Untitled Page and Untitled Page 2 Select and then click a second time on the Untitled Page 2 entry so that the name becomes editable and change the name to UIKit Examples as outlined in Figure 5 10 Figure 5 10 Note that the newly added page has Markdown links which when clicked navigate to the previous or next page in the playground eBookFrenzy com Purchase the full edition of this iOS 9 App Development Essentials book in eBook 12 99 or Print 39 99 format iOS 9 App Development Essentials Print and eBook ePub PDF Kindle edition contains 105 chapters Working with UIKit in Playgrounds The playground environment is not restricted to simple Swift code statements Much of the power of the iOS 9 SDK is also available for experimentation within a playground When working with UIKit within a playground page it is necessary to import the iOS UIKit Framework The UIKit Framework contains most of the classes necessary to implement user interfaces for iOS applications and is an area which will be covered in significant detail throughout the book An extremely powerful feature of playgrounds is that it is also possible to work with UIKit along with many of the other frameworks that comprise the iOS 9 SDK The following code for example imports the UIKit framework creates a UILabel instance and sets color text and font properties on it import UIKit let myLabel UILabel frame CGRectMake 0 0 200 50 myLabel backgroundColor UIColor redColor myLabel text Hello Swift myLabel textAlignment Center myLabel font UIFont name Georgia size 24 myLabel Enter this code into the playground editor on the UIKit Examples page the line importing the Foundation framework can be removed and note that this is a good example of how the Quick Look feature can be useful Each line of the example Swift code configures a different aspect of the appearance of the UILabel instance Clicking on the Quick Look button for the first line of code will display an empty view since the label exists but has yet

    Original URL path: http://www.techotopia.com/index.php/An_Introduction_to_Xcode_7_Playgrounds (2016-02-13)
    Open archived version from archive

  • Swift 2 Data Types, Constants and Variables - Techotopia
    replaced by eight hexadecimal digits representing the Unicode character Swift Variables Variables are essentially locations in computer memory reserved for storing the data used by an application Each variable is given a name by the programmer and assigned a value The name assigned to the variable may then be used in the Swift code to access the value assigned to that variable This access can involve either reading the value of the variable or changing the value It is of course the ability to change the value of variables which gives them the name variable Swift Constants A constant is similar to a variable in that it provides a named location in memory to store a data value Constants differ in one significant way in that once a value has been assigned to a constant it cannot subsequently be changed Constants are particularly useful if there is a value which is used repeatedly throughout the application code Rather than use the value each time it makes the code easier to read if the value is first assigned to a constant which is then referenced in the code For example it might not be clear to someone reading your Swift code why you used the value 5 in an expression If instead of the value 5 you use a constant named interestRate the purpose of the value becomes much clearer Constants also have the advantage that if the programmer needs to change a widely used value it only needs to be changed once in the constant declaration and not each time it is referenced As with variables constants have a type a name and a value Unlike variables however once a value has been assigned to a constant that value cannot subsequently be changed Declaring Constants and Variables Variables are declared using the var keyword and may be initialized with a value at creation time If the variable is declared without an initial value it must be declared as being optional a topic which will be covered later in this chapter The following for example is a typical variable declaration var userCount 10 Constants are declared using the let keyword let maxUserCount 20 For greater code efficiency and execution performance Apple recommends the use of constants rather than variables whenever possible Type Annotations and Type Inference Swift is categorized as a type safe programming language This essentially means that once the data type of a variable has been identified that variable cannot subsequently be used to store data of any other type without inducing a compilation error This contrasts to loosely typed programming languages where a variable once declared can subsequently be used to store other data types There are two ways in which the type of a constant or variable will be identified One approach is to use a type annotation at the point the variable or constant is declared in the code This is achieved by placing a colon after the constant or variable name followed by the type declaration The following line of code for example declares a variable named userCount as being of type Int var userCount Int 10 In the absence of a type annotation in a declaration the Swift compiler uses a technique referred to as type inference to identify the type of the constant or variable When relying on type inference the compiler looks to see what type of value is being assigned to the constant or variable at the point that it is initialized and uses that as the type Consider for example the following variable and constant declarations var signalStrength 2 231 let companyName My Company During compilation of the above lines of code Swift will infer that the signalStrength variable is of type Double type inference in Swift defaults to Double for all floating point numbers and that the companyName constant is of type String When a constant is declared without a type annotation it must be assigned a value at the point of declaration let bookTitle iOS 9 App Development Essentials If a type annotation is used when the constant is declared however the value can be assigned later in the code For example let bookTitle String if iosBookType bookTitle iOS 9 App Development Essentials else bookTitle Android Studio Development Essentials It is important to note that a value may only be assigned to a constant once A second attempt to assign a value to a constant will result in a syntax error The Swift Tuple Before proceeding now is a good time to introduce the Swift tuple The tuple is perhaps one of the simplest yet most powerful features of the Swift programming language A tuple is quite simply a way to temporarily group together multiple values into a single entity The items stored in a tuple can be of any type and there are no restrictions requiring that those values all be of the same type A tuple could for example be constructed to contain an Int value a Float value and a String as follows let myTuple 10 432 433 This is a String The elements of a tuple can be accessed using a number of different techniques A specific tuple value can be accessed simply by referencing the index position with the first value being at index position 0 The code below for example extracts the string resource at index position 2 in the tuple and assigns it to a new string variable let myTuple 10 432 433 This is a String let myString myTuple 2 print myString Alternatively all of the values in a tuple may be extracted and assigned to variables or constants in a single statement let myInt myFloat myString myTuple This same technique can be used to extract selected values from a tuple whilst ignoring others by replacing the values to be ignored with an underscore character The following code fragment extracts the integer and string values from the tuple and assigns them to variables but ignores the floating point value var

    Original URL path: http://www.techotopia.com/index.php/Swift_2_Data_Types,_Constants_and_Variables (2016-02-13)
    Open archived version from archive

  • Swift 2 Operators and Expressions - Techotopia
    values These operators both return Boolean results and take Boolean values as operands The key operators are NOT AND and OR The NOT operator simply inverts the current value of a Boolean variable or the result of an expression For example if a variable named flag is currently true prefixing the variable with a character will invert the value to false var flag true variable is true var secondFlag flag secondFlag set to false eBookFrenzy com Purchase the full edition of this iOS 9 App Development Essentials book in eBook 12 99 or Print 39 99 format iOS 9 App Development Essentials Print and eBook ePub PDF Kindle edition contains 105 chapters The OR operator returns true if one of its two operands evaluates to true otherwise it returns false For example the following code evaluates to true because at least one of the expressions either side of the OR operator is true if 10 20 20 10 print Expression is true The AND operator returns true only if both operands evaluate to be true The following example will return false because only one of the two operand expressions evaluates to true if 10 20 20 10 print Expression is true Range Operators Swift includes two useful operators that allow ranges of values to be declared As will be seen in later chapters these operators are invaluable when working with looping in program logic The syntax for the closed range operator is as follows x y This operator represents the range of numbers starting at x and ending at y where both x and y are included within the range The range operator 5 8 for example specifies the numbers 5 6 7 and 8 The half closed range operator on the other hand uses the following syntax x y In this instance the operator encompasses all the numbers from x up to but not including y A half closed range operator 5 8 therefore specifies the numbers 5 6 and 7 The Ternary Operator Swift supports the ternary operator to provide a shortcut way of making decisions within code The syntax of the ternary operator also known as the conditional operator is as follows condition true expression false expression The way the ternary operator works is that condition is replaced with an expression that will return either true or false If the result is true then the expression that replaces the true expression is evaluated Conversely if the result was false then the false expression is evaluated Let s see this in action let x 10 let y 20 print Largest number is x y x y The above code example will evaluate whether x is greater than y Clearly this will evaluate to false resulting in y being returned to the print call for display to the user Largest number is 20 Bitwise Operators As previously discussed computer processors work in binary These are essentially streams of ones and zeros each one referred to as a bit Bits

    Original URL path: http://www.techotopia.com/index.php/Swift_2_Operators_and_Expressions (2016-02-13)
    Open archived version from archive



  •