Give me a fulcrum and I will move the earth. -- Archimedes With DoKit, I'll save you an annual vacation. *** General front-end developerCopy the code
On September 17, The number of stars of Didi’s open source project DoraemonKit on GitHub exceeded 10,000, becoming the first open source project of Didi to achieve this milestone. Hereafter referred to as Dokit
In less than a year since its release on October 15 last year, DoKit has grown rapidly from 13 tools to more than 30. The number of STAR is among the top 1000 global open source projects; At present, more than 4500+ APPS are used, including BAT and other well-known large factory users; It has been reported by various mainstream technical media and well-known public accounts for many times. More than 20+ days on the list Github Trendeing; Received many good feedback from internal and external users; And 107 of those provided by 40 Molecules in PR from outside developers.
DoKit2.0 come
Github address: github.com/didi/Doraem…
When mobile development first started, everything was in a state of chaos. We had no wheels, and all the functional requirements were built by our own hands. As the community grew, wheels began to appear in the mobile code, which saved us a lot of time and allowed us to chat with our goddesses and dream of a happy life after work. It’s said that “the world is made by lazy people,” and programmers are definitely the best at it. We’ve packaged wheels to make it easier for ourselves and others, just to save a few lines of code. In recent years, mobile development has entered a new era, with various wheels popping up one after another. However, there seems to be a blank space for offline development tools, and there is no good solution.
Imagine this scenario:
When Nobita was quarreling with Panghu (product manager), UI ran over. Shizuka: "Nobita, nobita, why don't you follow the design, the color of your button is obviously wrong, the green is not bright enough." Nobita: "impossible, I am in accordance with the design draft to ah, the color value is not "#00FF7F", may be the problem of the mobile phone screen, this is cold screen." Shizuka: "I don't care, it must be that you didn't come to the design draft when you developed, please show me the code color value."Copy the code
But who are we? We are a group of people who are going to change the world, and our goal is the sea of stars. In the long struggle, we held the initiative, line by line, through code. One day DoKit came along, and when that little icon popped up on our screen, a smile came to my lips, and I knew I was going to win the battle. While I was at the movie theater with goddess after work, you were arguing with UI sister over a pixel. For the benefit of programmers, my team and I finally got the price of DoKit down. Here comes DoKit, which will appear on every developer’s screen, saving you an annual vacation.
Dokit were born
Shizuka: “Nobita, nobita, I heard that you recently developed a Dokit, they all say that it is very good, after using it, they almost save an annual leave, please show me, MY annual leave is almost used up.”
(At this time the big male’s face shows a proud jiao expression, thought: once you love me to ignore, now I let you can not afford.)
Nobita: “no, no, are a few small functions, mainly are the credit of the team.”
(Said and took out just bought XXX flagship a few, the first true 5G, big bath ba camera, waterfall screen…… . Go away, pull back, pull back.
Nobita: “Look at this icon on the desktop. It’s big and round. Let’s call it doraemon.” It will appear on every page you have, and it gives developers a quick entry to the tools list, so let me take a look at some of the main tools.”
(The following dialogue is fictional, if any, it is purely coincidental)
Common Tools
Sandbox browsing of common tools
Test little sister: “big male, male, hurry, just an online bug occurred, user information does not cause the failure of payment, I had a return in the test environment the function and emersion the bug, I doubt is locally stored data has a problem, but the development of the zha side has been off work, you help me think it over.” Nobita: “Don’t worry, don’t worry, take your time, let me open the Dokit sandbox and browse. You see, long press can be file sharing and delete, click can enter to see the details of the file content, sure enough, you see this order ID field saved null data, no wonder will fail to pay. Get them back here to work overtime and fix the bug. In the future, when you have data problems, you don’t have to go to the mobile side to check through the IDE, which saves you a dinner time in minutes.” Test sister: “Well, I’ll call them right back and tell them to work overtime. This Dokit is awesome. Here, big male, you can have the drumsticks for the night.”
Location simulation of common tools
Test little sister: “big male, male, the boss said that we there is something wrong with the positioning of the app, let me return to this function, I took my mobile phone in the office all around several times, but it has no reaction, continue like this let boss see thought I lazy, you are quick to help me do something, dinner I eat your big chicken leg to you.” Nobita: “This is not simple ah, you let your development brother access Dokit, open the analog location switch, drag the location icon, one key to help you modify GPS latitude and longitude. You don’t have to walk around the office anymore, but you need to exercise more. Words just say that finish, test little sister cast a look, big male cu……
DBView of common tools
Leader: “Big male, I recently found a magic device, integrated it, as long as the mobile phone and PC are in the same LAN environment, it can directly show the APP database in the mobile phone on the PC browser for modification, can greatly improve the development efficiency. However, one disadvantage of it is that I have to jump out to check the WIFI IP address of my phone every time, which seriously affects my development pace. Please see if you can help me integrate it into Dokit and open it directly to see the IP address of the current wifi. This is the address of the making it: https://github.com/amitshekhariitbhu/Android-Debug-Database. Big male: “ok, leadership, no problem, bag on my body, guarantee to complete the task.” (After all, the nomination for promotion will start next month. Finally, the leader personally finds me and assigns tasks to me. I still have to perform well. After an afternoon’s efforts, Nobita finally fixed this function and took a lofty name :DBView, fart fell fart fell to the leader that take credit.
Performance Monitoring
Test little sister: “big male, male, old user response recently our app not smooth operation, and traffic go more, under the leadership of command, the next version of the new features to slowly, we focus on the performance of the app and interface to a wave of optimization, after all, the user is god, god used too uncomfortable, we are out of work.” Nobita: “ok, ok, I just bought a house last week started to pay the mortgage, I don’t want to lose my job like this. We’re going to have a meeting right now to discuss and investigate performance optimizations.” 1, Google:Android performance optimization 2, Charles capture 3, merge related interface 4, optimize the layout level 5, solve most of the memory leak 6, time-consuming function asynchronous loading 7, compression image size…… After staying up late and working overtime for more than a week, The Noxiong team optimized the performance of the APP in various ways, especially for a large number of tests on low-end phones, and the performance was indeed greatly improved. Well, now we’re ready to meet. At the regular weekly meeting on Friday, Nobita’s team reported the results of the optimization plan and compared various performance indicators before and after the optimization. The leader looked at big male messy and hair tired of hair and panda eyes to big male said: “Big male ah, your team this performance is very good, nuo, I specially for you to apply for a wave of group construction costs, you take brothers to” big health care “, ah no, is to relax, after all, the body is the capital of the revolution ah. Just as the big male happy ready to receive the time, the leadership and speech. The leader: “Big male, I think you this time the performance optimization plan effect is particularly good, you see we now business iteration so fast, the next brother department they are busy writing business, no time to do optimization, or you help them optimize the performance of it.” Big male: “should of, should of, all be same company of, wait for a meeting after we begin to prepare to optimize.” Big male forced against almost can not open the eyes, thought: I knew that there is such a good thing, the original is behind the live waiting for me, but who let him is the leader, after all, next week and have to pay the mortgage. But the company has so many apps, one by one optimization, when will it be a head ah. I had to figure out a way to get performance tuning ahead of the business development process once and for all, if only the testers could be directly involved. So after a weekend of thinking and research and combined with the previous period of performance optimization experience, Nobita developed a set of solutions. After another week of working day and night, Nobita’s team integrated the solution into Dokit, and it worked. Now team Nobita has time to go to Big Health.
Visual Tools
Shizuka: “Hey, Nobita, it so happens that you also come to this restaurant for dinner. I still have a seat here. Why don’t you come and sit with me?” Goddess unexpectedly take the initiative to invite big male to have dinner together, such a good opportunity how can miss it. Shortly after sitting down, Shizuka hisa said, “Nobita, I heard that the performance optimization scheme you developed some time ago was well received by the team. Our UI team also wants a similar tool. That thing you taught me last time about opening layout boundaries in the developer debug option was really hard to use. Every phone manufacturer seems to open it in a different place. I’m really worried. You can see the color of the control. 2. Whether the control is aligned and centered. 3. It’s best to see the UI hierarchy. Bala bala……” Nobita thought that our team a product manager can not cope with it, and now another one. But who let her be a goddess, Nobita can only wry smile agreed down. Forget is a few overtime weekend, nobita finally completed the goddess’s needs. Early Monday morning nobita ran to Shizuka’s spot with his phone in hand and started showing off and getting recognition and praise. Nobita took the opportunity to date goddess to see the new Marvel blockbuster. Looking at shizuka’s bright smile, Nobita felt that the weekend had been especially worthwhile. The joy of programmers is so simple.
Weex tool post
Friday was supposed to be a day to look forward to, especially for Nobita, who, after many lonely nights and anticipation, finally got to go to the movies with Shizuka. The process of waiting for the end of work is always quite long, and it is not easy to stay until the end of work. Nobita closed the MBP moment subconsciously took a look at the leader’s office, the office door slowly pushed open, Nobita suddenly had a foreboding. Leader: “big male, prepare to go off work?” Big male: “have no have no, just prepare to go downstairs to have a meal, the leadership have what command?” Leader: “also nothing, not recently the company opened a new business line, in order to develop efficiency, the weeX technology stack, heard that our side of Dokit is quite powerful, omnipotent, ask can let us help them in Dokit also integrate several tools, improve their development efficiency.” Nobita: “Ok, no problem, leader. I’m going to…” (the words are not finished) the leader: “No problem, just off work, have a meal together, we talk about the relevant functions.” (During dinner……) After more than an hour of dinner time, the weex tools related functions are determined.
View the Weex cache. 3. Weex page information and performance information. 4Copy the code
But at the moment the big male is very worried, in the mind has been thinking about the 8:30 movie. The leader: “rightness, big male, next month’s promotion list I already helped you submit go up, refueling!” Sweep the haze just now, big male showed a very bright smile. After thanking the leader, Nobita raced to the cinema and sat next to the goddess one second before the film began. What are you waiting for, Dokit? Listen to me and integrate it!
Developer customization
One day Big male as usual to open the computer ready to write code, found QQ there is a flashing strange head. It turned out that a brother in the community thought the effect was very good after Dokit was connected, but his team wanted to customize some functions, but found no relevant introduction after looking through the documents, so they went to Nobita. Nobita reviewed the following code and found that he was busy writing features and ignored the structure of the code and did not have a unified external API implementation. Just this opportunity, Nobita on a wave of code reconstruction. If you want to add your own custom features to Dokit or want to participate in the development of Dokit features, you can refer to the following implementation:
The Android
Implement the IKit interface, which is the entry you see on the tools panel.
public class KitDemo implements IKit {
@Override
public int getCategory() {
return Category.BIZ;
}
@Override
public int getName() {
return R.string.dk_kit_demo;
}
@Override
public int getIcon() {
return R.mipmap.dk_sys_info;
}
@Override
public void onClick(Context context) {
DokitIntent dokitIntent = new DokitIntent(DemoDokitView.class);
dokitIntent.mode = DokitIntent.MODE_SINGLE_INSTANCE;
DokitViewManager.getInstance().attach(dokitIntent);
}
@Override
public void onAppInit(Context context) {
}
}
Copy the code
It also inherits the AbsDokitView, which is the floating window you see on the desktop.
public class DemoDokitView extends AbsDokitView { @Override public void onCreate(Context context) { } @Override public View onCreateView(Context context, FrameLayout rootView) { return LayoutInflater.from(context).inflate(R.layout.dk_demo, rootView, false); } @Override public void onViewCreated(FrameLayout rootView) { TextView tvClose = findViewById(R.id.tv_close); tvClose.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DokitViewManager.getInstance().detach(DemoDokitView.this); / / ToastUtils. ShowShort (" close "); }}); } @Override public void initDokitViewLayoutParams(DokitViewLayoutParams params) { params.width = DokitViewLayoutParams.WRAP_CONTENT; params.height = DokitViewLayoutParams.WRAP_CONTENT; params.gravity = Gravity.TOP | Gravity.LEFT; params.x = 200; params.y = 200; }}Copy the code
Finally, inject it into the Application OnCreate with the following method:
public class App extends Application { private static final String TAG = "App"; @Override public void onCreate() { super.onCreate(); List<IKit> kits = new ArrayList<>(); kits.add(new KitDemo()); DoraemonKit.install(this, kits); }}Copy the code
The iOS version
See adding a custom test module to the Doraemon panel
Dokit applets are already on the way
DoKit wechat small program DEVELOPMENT assistant SDK released :juejin.cn/post/684490… .
Members of the project
There are designers, Android developers, iOS developers and small program developers in the project team. We all work together in our spare time to make DoKit today.
External contributors
Huakucha, HuginChen, feng562925462, azhon, REx26, Csc-ericwu, Dengyuhan, 0xD-CC, K373379320, FABCz, Y500, Knightly -ZXW, Boai, Klone1127, DeveloperLY, Sagdragon, CCWorld1000
Thank you for every student’s efforts.
Dokit’s future needs your help
Official long-term incentive plan: https://github.com/didi/DoraemonKit/issues/256
Standing on the shoulders of giants
Dokit’s success today depends on the support and demands of the open source community. Here are some of the third-party open source projects introduced in Dokit:
Android
AndroidUtilCode
free_reflection
leakcanary-android
Android-Debug-Database
gson
guava
okhttp
iOS
BSBacktraceLogger
fishhook
MLeaksFinder
GCDFetchFeed
YYDebugDatabase