New opportunities for Android development-AI

I. Introduction

Since OpenAI became popular, I have been paying more attention to the direction of this area. The AI ​​part of the Google IO conference some time ago also accounted for a large proportion, and judging from Google's deployment, it is almost developing in the direction I expected. What I focus on is actually very simple, which is auxiliary development, and Google The content at the IO conference also made me realize that they are indeed developing in this direction. Although it is still at a relatively tasteless stage, this is a signal of entering the era of big AI.

作者:流浪汉kylin
链接:https://juejin.cn/post/7243725952789823525

recommend

Baiguo is a convenient and practical tool-like applet. You can use the applet with just one click. Your valuable comments and suggestions are welcome in the comment area.

2. Current situation

For the current environment, AI can already perform some basic auxiliary development. I have mentioned some of the simplest methods before, https://juejin.cn/post/7219868613667143737

At this time, someone said that it is too low for those of us who are developers to do these operations of copying and pasting after opening the web page. That's right, so generally the first step we hope to achieve is integration, integrating AI into our IDE.

1. Studio Bot

This Google IO conference has such a thing, Studio Bot , which integrates AI into Android Studio. Note that this is official. Although it is currently in a trial stage, at least it shows the official determination: to Make Google's own AI tool , and the things Google has produced in the past few years are often relatively popular, so I am optimistic that mature AI tools will be available in a few years.

If you want to know more, you can check out the official website https://developer.android.com/studio/preview/studio-bot. First, you need to download the latest version of Android Studio Hedgehog, and then follow the process to register and use Studio Bot. It is mentioned in the document card. It's quite clear, so I won't repeat it here.

But in fact, regardless of the fact that this thing has been proposed, it is actually relatively useless at the moment, and there are very few people using it now. Optimization and function expansion may be carried out in the future. I suggest that you just take a look at the demo. There is no need to download the preview version to try it. First of all, the preview version will have many problems. Secondly, as mentioned above, the current functions are relatively useless. I guess you will lose interest after playing for an hour or two. I think it's still too early to use it to directly assist development.

After talking about the official ones, we can talk about the currently mature plug-ins.

2. Small

Bito is a plug-in developed by the ChatGPT team, and our IDE can use this plug-in to assist development. If you want to know more, you can check out the introduction on the official website https://bito.ai/

The method of using Bito in Android Studio is also very simple. First, search for this plug-in

ec451f7c57572f9f4bf61b444d5b97c1.jpeg

Then install, then click Help ->Find Action and enter Choose Boot Java Runtime for the IDE

98b04f86cd765b18549bfa3caa487918.jpeg

There are two identical JCEFs in the select runtime. One is problematic and the other is normal. You will know after trying it. After installation, restart, then click Bito on the right side of AS to log in and you can use it.

76189f6cd872588e73b0f0ece068a4b0.jpeg

If you don’t have an account, just register one. The process is quite simple. You can use it directly after logging in.

53c2f6cfbe3bedc5f6a1ae29fb9ac1cc.jpeg

The advantage of Bito is that it is very convenient to introduce the whole process, but it also has an obvious shortcoming, that is, it is too slow. I don’t know whether it is because there are many people using it or some other problem, but its response speed is very slow. I gave it a json myself, and then asked it to generate a kotlin data class. It took a long time to generate it. I may have finished the code myself. Although it is slow, it is still usable. For example, if you have any questions, you can still ask him, but I would rather open the GPT web page and use it directly.

3. Github Copilot

Github Copilot is a plug-in like Bot, but compared to Bot, Github Copilot is faster and can do more (relatively more, but it’s actually quite useless)

The method used is also to directly search for Github Copilot via plug-in.

3dd48572b34d0301e3c9befea31227c5.jpeg

Install. After installation, it will restart AS, and then a notification will pop up asking you to log in to GitHub. It doesn't matter if you accidentally close it. There is also a picture at the bottom of AS that you can click on.

c0efccedc941cd89245f1a515b5e805a.jpeg

45bf5fc21ace2617fd7e894b81ca8c85.jpeg

Clicking Copy and Open will open github and let you enter the Device code. If you are not logged in, you will be logged in first (Github cannot be without an account)

f6522e66ce286f72ee773c1b66b06d15.jpeg

After entering, your github will enter this page, and there will be an extra Copliot in your github menu.

23d7ad0dedb5949ecf460547a49eb8b3.jpeg

So what is this for? This is charged, brother. You can have a free trial for one month, but you need to have VISA because you need to fill in the information. You have to fill in the information before it can be used, or you have educational emails (that is, students or teachers). Generally, you If you go to college, you will have a school email address. This is similar to Apple’s education discount.

But I strongly don’t recommend students to use this method to register, because as I said above, this function is actually not mature. If you play with it for an hour or two, you will lose interest, and then you will expose your information. I think this is a bit of a waste of money.

So those with VISA can try it out for a month, and those with money will just pretend I didn’t say so. Then there is no VISA and no school email address, so how can I do it? Buy an account. Is there a shortage of this kind of thing in mainland China?

Github Copilot has more powerful functions and performance than Bito, but the introduction of Github Copilot is not as convenient as Bito.

4. Summary

Here we introduce 3 AI tools currently available for AS, an official tool studio bot, two plug-ins Bito and Github Copilot, plus these 4 ways to open GPT directly on the GPT web page.

Personally, I am definitely most optimistic about studio bot. It is an official product and must be a high-quality product. I dare not say about other IDEs, but Android Studio will definitely be the best to use studio bot in the future.

For now, no matter which one you use, there will be a certain cost. The first step is to use the Internet scientifically. Some big guys from GPT will migrate out. Even if you don’t use the Internet scientifically, you can use it. The second issue is the account issue. It is relatively difficult to apply for an account like Github Copilot. I suggest you buy an account directly if you want to use it.

Finally, for auxiliary development at present (I may not be sure about other uses, I am more concerned about the effect of auxiliary development), the function is not very mature yet, to put it nicely, it may not be very useful to my development process. Big, to put it bluntly, I can type code faster than him.

Some people may think it is quite useful. I only represent my own point of view. When I develop, I am accustomed to using some templates, shortcut keys and some tools provided by AS. I can’t guarantee that everyone will use these tools, but as far as I am concerned, for example, taking Bot, you may like to give it some simple logic to generate code, but I use templates and AS tools to generate code. is faster than it is. Instead, I would use it when, for example, Json generates data, converts underline to camel case, or suddenly forgets some knowledge points, but in this case, I feel better to directly open the web page and use GPT.

3. Outlook

It is this Google IO conference. After the direction of AI was proposed, especially after these things were proposed this year, it actually had a huge impact on the future. This can be said slowly and step by step.

The first is a technical update for Android, such as JetPack, kotlin, flutter, etc. proposed by Google before. In fact, they are all very good technologies and need to be learned. Now it is equivalent to focusing on AI, so in the future, such technologies will be displayed. The cycle may be relatively longer.

Then there is a question that everyone is more concerned about. Will after the AI ​​technology matures, developers will no longer be needed, and AI will be enough, and all programmers will be unemployed. I don’t think it will reach this point. If it does reach this point, then AI can program itself. This situation is beyond imagination and is completely like science fiction. But I think that in the end, it can achieve the ultimate in auxiliary development. From a macro perspective, it can help us shorten the development time to less than half. Then it may appear that the company only needs one or two core members to cooperate with AI development, instead of the original five or six people. This actually depends on the boss. He thinks that your efficiency can be doubled due to the cooperation of AI. You can do the work of two people by yourself, so why should I raise two people when it is not more cost-effective to raise one? Of course, your boss will also think that if AI improves your efficiency, you can just finish your get off work and get off work at 6 o'clock, and you don't have to work overtime. In fact, when it comes to this, everyone understands it.

So whether this development is good or bad, I actually don’t know. But purely for development, it is definitely good. So how can we reach the level of assisted development I mentioned, and why am I so optimistic about studio bot?

We need to talk about some basics here,

We write code, we compile, package APK, etc. These operations are actually file operations. You can understand this. For example, the class file uses the dx tool to generate the dex file. Then I can write a script to do these operations, and write a script to operate the file.

For example, if I want to use json to generate kotlin's data class, I can use a script to do it. I can use the script to accept json input, and then let the script generate a .kt file of the data class according to the format of the data class. This script is It can be done, but this needs to be clear first.

So since what scripts can do, do you think AI can do it? Why don't I write a script to complete this thing? Because this thing is not troublesome, but it is more troublesome for me to write a script, but it is not troublesome to use AI to complete this thing, so this can obviously improve the efficiency of development.

But what is the problem with AI at this stage? It cannot get the context. To put it simply, it can only be used as a chat tool, and it cannot get the context of our project. "Help me generate a data file based on the following json and put it in the xxx directory." AI cannot currently implement this function, but it can do this effect so esay. At present, we can only ask him to generate a data class, and then it will be generated for you in the chat window. You can create a data class yourself and copy its contents.

So one of the reasons why I am optimistic about studio bot is because it is official, and I think it will be able to get context in the future. To give a simple example, it can get the entire project and read and write the entire project. Then the operations we let it do and what it says are based on the entire project. I will not spend a lot of time describing to him what I want. What I do will also save a lot of steps. When I use AI to integrate with the project, I have to go through some steps to convert it, and the conversion time is not as long as if I just code it myself.

If it can get the context of the project and I say to it "help me find the layout of the xxx page", it can help me find it directly. In other words, when we use retrofit to make network requests, we often need to write some scattered codes. I directly tell it "add a request named xxx based on the link, input parameters, and output parameters", and it can help me follow the format of other requests. to write to each file. If we can do this, it will greatly improve our efficiency.

"Write a LiveData for this XXXXActivity", "Check whether the current class may have a memory leak", "Help me put the current Chinese into string.xml" and so on. These operations are actually repeated operations in development. In fact, they are not very dependent on the business, and I believe that studio bot will eventually achieve this step.

The era of big AI has begun, where will this torrent take us?

Follow me to get more knowledge or contribute articles

d71041c6ee495e3ee2cf313d760f6fbc.jpeg

fc5ccabde52a4ea6d3faafffa168dd27.jpeg

Guess you like

Origin blog.csdn.net/c6E5UlI1N/article/details/132288365