Resume for Android (1)

Source: Internet
Author: User

Profile I am a fresh graduate. Due to my recent job search, some companies have chosen schools and have no chance to write a test for several times. So I decided to make things eye-catching, because I personally prefer Android Development (I personally think my J2EE is better, Android is just a degree of development, so I came up with the idea of creating an Android resume. Preview because I was originally applying for a job, so I would not hide the information or anything. I am not a designer or an artist, so if the interface is ugly, I hope you will not be surprised.
 

Step 1: Create a technical Menu, call text messages and calls, layout, and process pictures. This article does not teach you how to get started with Android, so I assume that you already have a certain level of Android. We first create an Activity-MainActivity and start to layout it. The main interface is the first image with my photo in the preview. We want to achieve this effect: the text is kept in the lower left corner, and the picture is kept in the middle of the top part. This layout is easy to implement. The outermost layer uses RelativeLayout to place the last row of text TextView on the leftmost part of the layout, and other texts are arranged on the top of the text; the Avatar center the ImageView, And the marginTop setting is about 40dp. In this way, our layout will come out. As for text Styles, you can adjust them by yourself. I think white is quite good. I prefer simple colors. The layout file is activity_main.xml. You can view the specific code. Step 2: Take a circular image. Next we need to process our photo. To ensure the quality of the photo, we do not need to stretch the photo. We can use different photos for devices with different resolutions. Let's talk about the photo. Let me explain how to create a circular image first. The principle is very simple: import a Bitmap with a Canvas, take a circle in the Canvas, and then place our photo inside. First, we need to deal with the height and width of the photo, and find the center of the photo, capture the largest circle, and then take the intersection of the circle and the photo to get a circular photo.

// Process Bitmap as a circular image private Bitmap circlePic (Bitmap bitmap) {int width = bitmap. getWidth (); int height = bitmap. getHeight (); int r = width In this way, the circular image is processed. We only need to set the processed image to the control we have defined. The specific code is as follows:
ImageView myPhoto = (ImageView) this. findViewById (R. id. myPhoto); // my_photo.setImageResource (R. drawable. ic_launcher); // obtain the Resources object Resources r = getResources (); WindowManager manage = getWindowManager (); Display display = manage. getdefadisplay display (); int screenWidth = display. getWidth (); // read resource InputStream is = null in the form of data streams; if (screenWidth> 480) {// This code is used to display different photos according to different screen sizes. In fact, there are different processing methods, but I think this can also meet my needs. is = r. openRawResource (R. drawable. my_photo);} else {is = r. openRawResource (R. drawable. my_photo1);} // obtain BitmapDrawable object BitmapDrawable bmp draw = new BitmapDrawable (is); // obtain BitmapBitmap bmp = bmp draw. getBitmap (); myPhoto. setImageBitmap (circlePic (bmp); // set the circular image to myPhoto in ImageView. setOnClickListener (new PhotoClickListener (); // you can specify a click event.
Now, we have drawn a circular image and the overall layout. That is to say, we have achieved this picture: at the end of the next article, we will create the menu and the next interface. I have hosted this project on Github. You can download the source code, and I will continue to improve this project. Managed address: https://github.com/xjyaikj/androidresume

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.