Welcome to Delicate template
Header
Just another WordPress site
Header

This is a summay of the tricks I have learned making an application called courseApp project.  This application was developed in the Mobile Information Systems that I took at University of Oslo. Eclipse is a very good tool to use for Android development. To start with you need to download Andriod SDK. After installing both of these(and ofcourse Java Development Kit, JDK which is a pre-requirement for both of these), you need to make Eclipse and Android SDK talk together. This is done by a plugin called “ADT plugin for Eclipse” from Google. You can read more about how to install this plugin by clicking hereIn case of Android SDK installation(the exe file) doesn’t recognize JDK on your computer, you can simply download the zip file and extract it. Don’t forget appending that folder to the %PATH% environment variable. Now some more tips follows :

background color for your layout :
add the following code to your layout XML code(#ff32cf is the color code)

android:background="#ff23cf"

Background Image for your layout :
1- Add the image you want to the layout folder of your project.
2- Add the following code to your layout XML code

android:background="@drawable/bbg"

EditText features :
one of the features I want to talk about is android:singleLine which is very useful. If you want to get some info from the user, this text box is a good tool to use, but make sure you set the SingleLine variable to true. If not if they paste a 20 lines of text by mistake your whole GUI gets out of shape. Also if you want to use this for example to write an email text, then this should be set to false as you want it to contain several lines. The good thing about several lines EditText is that they do have scrolling function.

<EditText ... android:singleLine="true">//Single Line box for getting email address
</span><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"><EditText ... android:singleLine="false">//Multi Line box for getting email text

in case you want limit the number of lines of an EditText:

<span style="font-family: monospace; font-size: 12px; line-height: 18px; white-space: pre;"><EditText android:layout_width="fill_parent"</span>
<pre><code>            android:layout_height="wrap_content" android:gravity="center"
android:singleLine="false" android:lines="5"
android:layout_marginLeft="10dip" android:layout_marginRight="10dip"
/></code><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">

 

Simple Item List :
Setting up a simple Item list with an already filled Arrayadapter.


static final String[] COUNTRIES = new String[] {"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra","Angola", "..."}
<pre>setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, COUNTRIES));
getListView().setTextFilterEnabled(true);</pre>

Drop Down List :
In Android drop down list is a little bit complicated to give value to. You first need to add one Spinner to your layout and then connect it to

 String[] Countries = { "India", "France", "Japan", "China", "U.S" };

// //////////////////Countries Spinner/////////////////////////////////
SpinnerCountries = (Spinner) findViewById(R.id.Spinner01);

// //////////////////////////////////////////////////////////////
// create an arrayAdapter an assign it to the spinner
AdapterCountries = new ArrayAdapter<CharSequence>(this,
android.R.layout.simple_spinner_item);
AdapterCountries
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
SpinnerCountries.setAdapter(AdapterCountries);

int lenCountries = Countries.length;

for (int i = 0; i < lenCountries; i++) {
// test += Areas[i] + "\n";
AdapterCountries.add(Countries[i]);
}

source

Disabling the Landscape Mode :
You have two ways to do this, either in the code, or in the XML layout file :

XML :

</span><span style="font-family: monospace; font-size: 12px; line-height: 18px; white-space: pre;"><activity android:name=".SomeActivity"</span>
<pre>
<pre><code>              android:label="@string/app_name"
android:screenOrientation="portrait"></code>

OR in the code :

[/java]

setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);     //  Fixed Portrait orientation[/java]

Layouts in Android :
LinearLayout :
LinearLayout aligns all children in a single direction — vertically or horizontally, depending on how you define the orientation attribute. All children are stacked one after the other, so a vertical list will only have one child per row, no matter how wide they are, and a horizontal list will only be one row high (the height of the tallest child, plus padding). A LinearLayout respects margins between children and the gravity (right, center, or left alignment) of each child.

TableLayout :
TableLayout positions its children into rows and columns. TableLayout containers do not display border lines for their rows, columns, or cells. The table will have as many columns as the row with the most cells. A table can leave cells empty, but cells cannot span columns, as they can in HTML.

RelativeLayout
RelativeLayout lets child views specify their position relative to the parent view or to each other (specified by ID). So you can align two elements by right border, or make one below another, centered in the screen, centered left, and so on. Elements are rendered in the order given, so if the first element is centered in the screen, other elements aligning themselves to that element will be aligned relative to screen center. Also, because of this ordering, if using XML to specify this layout, the element that you will reference (in order to position other view objects) must be listed in the XML file before you refer to it from the other views via its reference ID.

courseApp

February 18th, 2011 | Posted by Shahab in My Projects | My Studies | Shahab | UiO - (0 Comments)

This is a school project for a course(INF5261 – Development of mobile information systems and services) I take at department of Informatics at University of Oslo. courseApp is an android mobile application which allows the users(students at University of Oslo) to add their courses to this application and respectivley receive the latest updates about the course on their cellphone. We also are thinking about integerating the time & place of the courses with the students android calender. We have plans for further development of this application but this is all dependent on if we can get access to the database in StudentWeb. If we do so we would be able to let students add courses to navigate through the courses and join the course by just one touch click …

We have thought to have following functionalities on our program(numbers show also priority).

  1. My courses
  2. Latest messages on course page
  3. Warning on Email
  4. Integration with Android Calender
  5. Friends taking same course

read more about our project at Our Wonder Document.

People innvolved :

  • Akbar(Shahab) Faghihi Mughaddam – shahabfm( at )usit.uio.no
  • Shahab Bakhtiyari Saravan – shahabb( at )ifi.uio.no
  • Ummair Tahir - ummairt( at )ifi.uio.no
  • Piraba Kaugathasan - pirabak( at )ifi.uio.no

As the programming phase is almost finished, we have entered the design phase. We are working on our 3D design and plan to buy tracking belts and sprocket wheels. At the same time we are discussing the sponsorship of the project with RobotShop.com & hope we receive a positive answer from them. You can read full reports on our activities & have full access to our codes and designs on Super Crawler worklog at Robotica Osloensis forum or the project weblog.

Bilde

I am now a member of student robotics community at university of Oslo, called Roboitca Osloensis. I have joined the board team and currently I am in charge of all projects at the community. Our first project will be my summer project from last year( Super Crawler ), which we did not finish it …

New Ideas on Robot feet …

March 20th, 2010 | Posted by Shahab in My Projects | My Studies | Shahab | UiO - (0 Comments)

I got some new wild ideas about how actually the hardware part of the climbing robot should look like. Well these are nothing that would come to real world but just some drawing form me in my free time …

(more…)

PHP project, report #1

December 20th, 2009 | Posted by Shahab in My Projects | Shahab - (0 Comments)

I have already made a login system successfully with ability to login for users and root. The login system can redirect users to user pages and root to administration page. The root user has the power to delete or update the user informations(facing some difficulties here). The goal with this part was gaining experience with PHP and Mysql database.

Next step in this project will be debugging and securing the login system and designing the right database tables for the main project(game).

UiOToolbar v0.03 launched

December 15th, 2009 | Posted by Shahab in My Projects | Shahab | UiO - (0 Comments)

UioToolbar Version 0.3 is available. For downloading the Firefox extension click here, for source files click here. This version contains upgrade for Firefox 3.5. I have added new buttons for searching at UiO’s library. I have also added useful links to different faculties and IT support and webmail at university. More info about UiO Toolbar can be found here.

PHP based website project

December 11th, 2009 | Posted by Shahab in My Projects | Shahab - (0 Comments)

Recently I have been talking to a colleague to make a PHP based website with MySql database. The code with the database is supposed to make lists over users who play a roleplaying game online. More info about project later. Most likely it is going to be an opensource project.

Compiler for a simplified C

November 21st, 2009 | Posted by Shahab in Shahab - (0 Comments)

My friend (Jim) and I are finally finished with coding for a compiler in Java. The compiler is implemented in Java to run the code written in a language called Rusc wich is a kind of simplified C. The language contains integer, variables, functions, IF, Else, While, for, expressions, names, libraries of pre-coded functions. We finished testing and running the code. This code was written for a course at university of Oslo, IFI, called INF2100-Programming project. The code is available here.

Mahibaz.ir back on track

September 29th, 2009 | Posted by Shahab in Shahab - (0 Comments)

My website about fish keeping(specially Discus fish) with a Forum is back on track once again. After I didn’t get to take back my old domain name with .com postfix(www.mahibaz.com) back, I had to start over with a .ir postfix(www.mahibaz.ir). After all the website is in Persian and it doesn’t do anything to have a .ir(iran) domain name :-)

So the project is back on track with the domain name www.mahibaz.ir and we have our fish keeping forum back online as well.

Mahibaz in persian means a person whose life is just fish keeping.

Shahab.