'''Originally Posted By: animeshd'''
Problem 1 and Problem 2<br><br>Q1. A) Explain the difference between an Emulator and a Simulator<br>&bull; A Simulator creates an environment via the libraries that &ldquo;simulates&rdquo; the mobile device&rsquo;s environment. Runs Machine Code of desktop.<br>&bull; An emulator reads machine code for the target device and creates environment on desktop that looks the phone. Runs Machine Code of the Phone.<br>Q1 B) Setting the Icon (Android)<br>&bull; Take a 48*48 PNG- drop it in res/drawable<br>&bull; Open AndroidManifest.xml<br>&bull; Add attribute to application =&gt; android:icon=&rdquo;@drawable/icon<br><br>Q2)<br>a) A class method<br>Open the header of your program, underneath the @interface tag, add the following line<br>+(return type) method Name: (type) param<br><br>b) Instance in Objective &ndash; C<br>-InstanceMethod{<br>//implementation<br>}<br><br>c) Argument Passing in Objective &ndash; C<br>[obj method:parameter];<br>Where obj is Class object<br>Method is a method of that class<br>Parameter is the parameter that we are passing.<br>For passing more than one parameter:<br>[obj method:parameter1 paramName2: parameter2]<br>Where paramName2 is the name of the second parameter<br><br>Group Members:<br>Dhruv Jalota<br>Animesh Dutta<br>Kevin Grant<br>Jiajie Wu<br>ChingYing Kuo
'''Originally Posted By: smokkapati'''
Question 7:<br><br>iPhone:<br>The following method will be called when the device orientation is changed. Write your code inside this method as required to change the layout.<br>In your ViewController.m file write this method:<br><br>- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {<br> <br> if (interfaceOrientation == UIInterfaceOrientationPortrait) {<br> // This means new orientation is portrait.<br> } else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {<br> // This means new orientation is landscape left.<br> } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {<br> // This means new orientation is landscape right.<br> } else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {<br> // This means new orientation is portrait upside down.<br> }<br>}<br><br>For HTML5:<br>(function(){<br> // Orientation Change<br> // When orientation changes event is triggered<br> // exposing an orientation property of either<br> // landscape or portrait<br> ('body').bind('orientationchange', function(event){<br> changeOrientation(event.orientation)<br> })<br><br> // Change the style depending on orientation<br> function changeOrientation(ori) {<br> // Remove all classes<br> ("#orientation").removeClass('portrait landscape');<br> (&quot;#orientation&quot;).addClass(ori);<br> $(&quot;#orientation&quot;).html(&quot;
&quot;+ori.toUpperCase()+&quot; &quot;);<br> }<br><br> $(&quot;body&quot;).trigger(&quot;orientationchange&quot;);<br> })<br><br>Group Members:<br>Snigdha Mokkapati<br>Vy Luong<br>Xiu Guo
'''Originally Posted By: shailbenq'''
Solution 4 : by Chinmay bhawe, Eugene, Ajinkya amrute and Shailesh Benake<br><br>Show the necessary code and describe any interface building activities needed to create a small app (platform of your choice from amongst those covered this semester) with a button on it, which when clicked opens an alert dialog with the words &quot;Cancel Me!&quot; on it. When the user clicks cancel me, the alert goes away.<br><br>Android way -<br>step 1: Go to the layout (say main.xml)<br>step 2: Add a button to the layout,set its id to say &quot;button1&quot;<br>step 3:<br> Set method Attribute as,<br> [ android:onClick = &quot;clickerMethod&quot;]<br> now add a method by the name &quot;void clickerMethod&quot;<br>code:<br> Code: public void clickerMethod(View v)<br>&nbsp; &nbsp; &nbsp; &nbsp; { <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AlertDialog.Builder bd = new AlertDialog.Builder(this);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bd.setNegativeButton(&quot;Cancel Me&quot;, new DialogInterface.OnClickListener(){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void onClick(DialogInterface dialog,int d){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dialog.cancel();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AlertDialog confirmation = bd.create();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;confirmation.show();<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br><br>I executed the above code on emulator its working fine as mentioned in the question<br>
'''Originally Posted By: arshiagrawal'''
Problem 6: For either iOS or Android, give the code to make the keyboard go away if the user clicks outside of the text input area.<br><br>Android:<br>In the onclick method of relative layout's onClickListener, write the following code to make the keyboard go away when user clicks outside the text area - <br><br>EditText dicEditTextID= (EditText) findViewById(R.id.EditText01);<br>InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br>imm.hideSoftInputFromWindow(dicEditTextID.getApplicationWindowToken(), 0);<br><br>Group members:<br>Arshi<br>Carlos<br>Chinmayee