Experts talk: Must-read experience sharing for Java programmers switching to Android development

Experts talk: Must-read experience sharing for Java programmers switching to Android development

[[138069]]

Let me talk about the differences between Java and Android programs:

Android is the mainstream smartphone operating system, and Java is a development language. There is no difference between the two, they are just two choices of career positions. Learning Android can lead to mobile Internet development, while learning Java can lead to software and website development. Most of the applications on Android are written in Java, so it is recommended to learn Java carefully in the early stage of Android learning.

Briefly talk about the preparation before "transfer":

In fact, it is not difficult for Java programmers to self-study the basic knowledge of Android development. After all, the languages ​​are the same and the features are similar. The threshold for reading Android source code is relatively low. As a qualified programmer who can consider "changing", self-study ability and related basic knowledge should not be a problem for you, and learning Android should be relatively easy.

Therefore, Java programmers switching to Android development can be seen as an "incremental update". They only need to learn the basic components of Android: Activity, ContentProvider, Service, BroadcastReceiver;

Understand the Intent, Handler, Adapter and the delivery methods of various events in Android (onClick, onTouch, etc.);

At the same time, a certain amount of code is provided, such as JNI, AIDL, etc.

You also need to abandon the concept of "pixel position of UI elements". Android itself allows you to create UI by setting element positions. If you do this, the result will be that a large number of machines will not be compatible, and the display effect will be a bit terrible. So don't dream of adjusting the UI by obtaining the screen size. Things like LinearLayout, which are dispensable in swing or swt, must be mastered on Android.

Also be familiar with IDE, the development framework provided by Android, Java and other programming knowledge, etc.

Of course, what I have said here is just a drop in the bucket. There are still many details that need to be paid attention to during the development process that we have not mentioned.

Below, I will share with you the experience of predecessors in transitioning from technology development to mobile application development, hoping that it will be of reference to everyone:

Tiefeng Liu, CTO of Dolphin Browser

Because the specific development scenarios are different and the target readers have different experiences, I would like to share some additional knowledge points and logical changes that need to be made during the transformation process.

What are the differences between mobile development and development on PC?

In my opinion, since 2002, traditional desktop developers have basically turned to development methods based on Web technology or server-side development technology such as J2EE/.NET/LAMP. There are fewer and fewer users who use C/C++/MFC/Delphi to develop C/S models, and even the demand for work has begun to decrease.

In this way, in terms of technical system, developers' experience basically covers:

1. HTML + CSS + JavaScript

2. Various scripting languages ​​(PHP/ASP.NET/JSP/Python/Ruby) to operate server API

3. Server data processing logic (O/R Mapping, database connection pool, various design patterns such as AOP, even DSL, etc.)

4. Architecture design of large servers (distributed architecture, various load balancing, server connection optimization)

5. Database (distributed database, transaction processing, large-scale data storage, query optimization)

6. Big data processing (Hadoop, Hive), etc.

So what is needed for mobile development?

Regardless of Android/iOS/WP, the development needs have gradually returned to the period before 2002, which is probably more appropriate than the era of MFC/Delphi.

The skills required of mobile developers have changed, and the required experience has become:

Fully understand the process architecture and program life cycle logic of each mobile platform (program startup, program suspend/kill by the system, Services)

1. Interface design (various UI controls, event handling)

2. Data processing logic (client cache, multi-threaded concurrency)

3. Network data processing

4. Platform-related features (system API calls, system notification mechanisms, etc.)

5. Various performance processing.

Therefore, there are differences in the learning routes and the experience required.

If you need to transform from a non-mobile developer to a mobile developer, even if you are still using the Java language, all you need to do is understand different libraries and handle specific problems in different fields.

In the development of mobile devices, I have classified the problems into three categories: performance problems, interface response problems, and product stability. These are what technicians need to pay the most attention to and ensure.

Ji Yichao, Founder of Peak Labs

I remember when the iPhone came out, people saw a completely different concept of logic from the traditional "window": in terms of interface, an application took up the entire screen, and in terms of program code, all code ran in a strict sandbox. At that time, I realized that this would be a whole new set of rules. Later, I gradually looked deeper from the surface. After writing bad code for several years, I gradually gained some experience:

1. Deemphasize the existence of files and highlight applications and workflows.

2. Try to avoid the main thread/UI thread and avoid locking the interface. Because if the desktop application locks the UI, it is just a window, while the mobile application will give people the feeling that the entire "phone" is down...

3. Don’t rely on the background for operations/calculations that can be completed quickly, as your own programs may be killed at any time. The background is only used for VOIP, network operations, etc.

4. Try to speed up the startup. Mobile products are frequently used, but the single use time is much shorter than that of desktop products, so don’t let users wait like Photoshop. Even if you use a "false impression", you should make users feel that the startup is fast.

5. It is best to have multiple interaction/operation methods for the same function. Unlike Windows, which dominates the desktop world, the usage habits of users of various versions of Android and iOS are very different. It is best to make people's habits work.

6. It is best not to make the UI controls too conspicuous (for example, the huge joystick in the arcade game covers the character), but don’t make it too obscure (Mammoth Browser 4, hahahaha).

.Users actually care about power consumption and heat generation, but desktop users never care…

8. When others say that many functions cannot be done or that the platform does not allow them to be opened, there are always people who use incredible and bizarre methods to achieve them...

Please don't trust my humble opinion~

Wang Sida, loves Android, loves flashing, and loves mobile Internet

When switching from desktop to mobile, it is important to recognize the different focuses of the two. Desktop, including the web, focuses more on logically complex and advanced tasks, while mobile is significantly more entertaining.

Let's start with the operation method. The desktop mainly relies on the mouse, keyboard and touchpad, so the operation accuracy is much higher, and it is easy to integrate many functions into one interface; but the same idea is completely inapplicable to the mobile terminal (I really can't think of a counterexample, you can help me think about it). I believe that an app with a cluttered UI, no matter how powerful it is, will make users dizzy if they stare at your interface for more than 3 seconds, and it takes several clicks to successfully click a button, which must be a bad app.

So what kind of operation method is suitable for mobile terminals?

The sliding operation of ListView is a good example. Users do not need to think about it. They just need to slide in the direction of the expected content. Intuitive design is king. Similar designs include pull-down refresh from Tweetie, ViewPager introduced in the standard library of Android 4.0, etc. The above operations have one thing in common - gesture operation. Since the mobile terminal (whether it is a mobile phone or a tablet) is a device held in the hand, it is not surprising that gesture operation has become its killer feature, and naturally it has become an important feature that distinguishes the mobile terminal from the desktop terminal. PeakJi's Mammoth Browser and Input Method (I forgot the name) also reflect this point.

With simple and intuitive gesture operation, there is another feature that cannot be ignored - push notification. Users are lazy. Even if a machine has hundreds of apps installed, your app may only be opened once or twice a month, which is certainly not what you want to see. If your app is a website client, then push notification is a great tool. How to do it? I have summarized the following process:

1. Connect with social networks, obtain user information, and analyze user interests

2. Record the user's usage habits on your website or client, and gradually approach the user's real interests

3. Push content that the user is interested in based on the user’s interests

As you can see, it is not as simple as "notification". For example, if Sina Weibo posts one palm news a day, too much will only make people feel annoying and will not achieve the effect of good communication with users. Only by pushing content that users are interested in can you attract their attention and increase the weight of your app in the minds of users.

The last point I think is very important is consistency. You must keep the same operating habits as the operating system. For example, the back button in the upper left corner, the sliding tab change of ViewPager in Android 4.0, etc. The biggest benefit of doing this is that it reduces the user's learning cost and allows your app to be integrated with the OS. Of course, under the big framework of the OS, there are also many innovative apps, such as Maluuba, a Siri-like app under Android, which boldly adopts the Metro style design, but it does not feel strange to operate, the biggest reason is that the sliding operation of ViewPager is retained.

<<:  iOS UIWebView URL interception

>>:  Analysis of three methods for calculating dynamic row height in tableView

Recommend

Old Secretary: "Teaching You to Become a Master of Social Interactions"

Training course content: Do you have such confusi...

How to choose high-quality advertising channels?

Today we come in and talk about the logic of bran...

The underlying logic of fission activity operation

In recent years, everyone has been working on pri...

Oreo Advertising Creative Collection

I don’t like cookies, especially sweet cookies, s...

Lu Songsong’s Blog: How can website SEO surpass your competitors?

1. Whether it is optimized or not, you can see it...

Microsoft releases an Android app called "Microsoft Apps"

Although the title is a bit confusing, Microsoft ...

Why has Douyin recently produced a hit marketing case?

How to prove that a product is popular? From bein...

Before launching a new APP, operations should do these four things

When I was young and ignorant looking for a job, ...