How to create a VK application yourself: step-by-step instructions

Telegram channel Programmer and business. Every day there are interesting stories about how a programmer builds a business.

This article is not for programmers (they already know all this), but for those who are just approaching the topic of programming. Or for those who just heard the term VK API and want to understand what it is.

Illustration on the topic VK Api: interface description, examples of work, documentation

Choosing a programming language and defining it with an idea

Before you create an application in VK yourself, decide on the idea. It must be original and unusual. There are many different projects on the social network: listening to music or radio, finding new friends, managing your profile. In addition, many popular applications allow the person who created them to earn good money.

You can create a game that will attract players with an unusual idea. For example, an interesting quest or online strategy. Also popular are programs that allow you to expand the functionality of VK, including creating a clone of the VK application or changing the interface theme.

If the game mechanics are simple but original, there will certainly be fans. Also, try to use already known gameplay if you decide to create a game. Implement the project so that users want to play it. The most popular games by genre are:

  • Games known from childhood, for example, lotto, tic-tac-toe or “Find the Differences”.
  • Card games and solitaire, including modern ones and poker.
  • Casual arcade games, like Tetris or match three.

Please note that once created, it is not possible to change the genre or variety. Therefore, decide exactly what you want to develop early on.

After choosing an idea, carefully read the VK documentation, which is intended specifically for developers. To find out more, follow the link vk.com/developers. Then go to the “Documentation” section and carefully study it in its entirety.

What is an API

From the technical side, the VKontakte website is a complex set of programs that run on the company’s servers. The result of their work is displayed in browsers or mobile applications in the form of a familiar social networking site. Users can interact with the site - publish articles, conduct searches, subscribe to communities, and so on. All these actions are provided by programs that work completely unnoticed by visitors.

There can be a lot of these programs (scripts, as programmers call them), and they must interact with each other. For this purpose, special rules and protocols have been developed, following which individual scripts are able to answer calls and receive responses from others. As a result, all the huge variety of different scripts work as a single whole.

The set of these rules constitutes a single interface for interaction with a complex software system. It is called API - Application Programming Interface.

The interaction of software modules precisely through the API library is a generally accepted norm. Without such a mechanism, it would be simply impossible to build complex software systems. After all, then each script would have its own rules for receiving external commands and producing results. The interaction of each two separate scripts would have to be programmed separately, and the entire project would be buried under a huge pile of disparate rules. There would be no way to understand them. If the project is initially based on the principle of modules operating only through the API, then the whole variety of interactions comes down to a few simple rules that are universal and suitable for any script. It is very comfortable.

How can this mechanism be useful to a simple programmer who is not on the staff of the VKontakte company and just wants to write some useful script for himself?

Illustration on the topic VK Api: interface description, examples of work, documentation

How to create a VK application

Before you make an application for VK yourself, decide on its type. There are only two of them on the resource:

  1. Iframe projects are created using special browser tools. Data is received and transmitted using JavaScript. People who launch your project will be taken to a separate window in the browser, then they will be able to use it.
  2. Flash applications are files with the extension .swf. They are created using Adobe Flash, after which they are compressed into a file and uploaded to the server.

Developing VK applications requires certain skills, but special social network tools can help in creation.

Via VK

How to create an application for VK Apps? To do this, you should use a service from a social network. Using it, developers can create their own services for use inside the Vk mobile application. Follow the step by step instructions:

  • Go to the main page of the Vk Developers website (https://vk.com/dev). You must be logged in to the social network.
  • Go to the “My Applications” tab.

  • In the window that opens, click on the create project button.

  • A form will open with lines to fill out. Enter the name of your project, select the platform, type and category. You can also add a description that will tell you about all the advantages of your application.
  • Click on the “Proceed to Download” button and upload the file. After which you will need to confirm the action using your mobile phone.

To create VK applications you need API integration. It allows you to open installation and project settings windows, as well as invite friends and enter votes. Inside it is possible to get the balance of the user and the event if the installation or change of settings was successful.

How to create an application in VK for a group? To do this, select the “Embeddable application” option in the designer, then check the “Community application” checkbox.

After sending, officials of the social network VKontakte will check your finished project and decide whether it will be included in a special catalog.

Programs for development

Creating an iFrame application in VK is possible using special programs and services. This will help if you don't want to waste time learning programming languages ​​and other intricacies.

To create Flash projects, you will need to learn how to work with Adobe Flash. It’s not easy for a beginner to figure it out at first, but it will allow any PC user to create a complete and high-quality project.

If you don’t have time to learn the basics of programming, then you can use services and software for developing VK applications. But, as a rule, free versions have limited functionality. Therefore, to get a full-fledged finished project, you will sometimes have to pay a lot of money. The most popular programs for mobile devices are:

  • designer 3apps.ru;
  • Appmarkt;
  • iBuildApp;
  • AppGeyser.

The BeApp service allows you to create an application in a VK group in which you are an administrator. The constructor is integrated into the community in a few clicks. Basic features are available for free. With the built-in editor you can fine-tune each element.

You can create an iFrame or Flash VKontakte application for free by studying the features of programming and applying them in practice. When using third-party software, be careful, because utilities and programs require permission to access your account.

Professional work

The easiest way to create it is to order development from a team of professionals. This method can be expensive financially, but has several advantages:

  • Saves time because you don’t have to learn the basics of programming and work on the project yourself.
  • You will be able to avoid errors that often appear after testing the project.
  • Specialists will complete the project not only at a high level, but also quickly enough.
  • It is possible to make a VK application not only in Russian, but also in English.

All you have to do is get a ready-made project that can gain great popularity among users. If you need your program or yoke to make money, then it will be able to recoup all the costs of professionals in the future.

We receive a token for using the VK API.

Now we need to get a token, also known as “access_token”. A token is a set of various numbers and Latin letters that we will transmit to the server along with the request.

In order to get it, we need to enter the following line in the browser:

1 https://oauth.vk.com/authorize?client_id=5490057&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=groups,offline&response_type=token&v=5.52

Where “client_id =5490057 ” you must indicate your “Application ID” number, which we received earlier. It is also necessary to specify the value “scope= groups,offline ”, this variable indicates what rights we give to the application, groups - access to groups, offline - the validity period of the token, in our case unlimited.

In “scope=” you indicate the rights you need through a comma. For example, if we also want to use the “friends.add” method, it requires “friends” rights, then in the line we indicate the following: “scope= groups,friends,offline .” The name of the rights for certain methods can be found on the VK methods page.

After we click on the link, the following window will pop up:

API VK - getting a token
We click allow and get to the page where we can get our token. To be more precise, we need part of the link string in the browser that was returned to us. For example, we get a link like:

1 https://oauth.vk.com/blank.html#access_token=68f5660720767e2659e96470bfd4be242e6d54d0d6062a1ee545214db91d33e8a8d35f91a8b62adfcf7ff&expires_in=0&user_id=433336

All the characters that go between “…access_token=” and before “&expires_in…” are our access key, also known as a token. My token will be like this:

1 68f5660720767e2659e96470bfd4be242e6d54d0d6062a1ee545214db91d33e8a8d35f91a8b62adfcf7ff

Then you can use it for your needs.

Application sources

Creating a project does not have to start from scratch. You can use source codes, which some developers distribute for free on the Internet. They can often be found on forums or file sharing sites.

If you need a source whose data cannot be found, you can do the following:

  • Install the application for yourself and launch it.
  • In the window that opens, right-click to open the context menu. Here, select the "Source Code" option for the page.
  • A search bar will appear where you need to write http:\/\/. A list of links will open.
  • Find the file with the .zip extension in the list and copy it to the clipboard.
  • Paste the link into the address bar of your browser, removing all slashes, and press Enter.

After this procedure, the archive will be downloaded to your hard drive. Replace the archive extension with .swf, after which you can open it in Adobe Flash or any convenient program. To start working with the source, you need to get its code. This is done through decompilation, a complex process that recreates the source from machine code.

Application development in VK is available to any user, provided that he is familiar with the basics of programming and intends to improve his skills. Creating a project can take a long time, so an alternative is to use custom constructors. In addition, to obtain a more effective result, you can always use the services of professional developers.

Possibilities of native VKontakte

VK API allows you to do a lot. News is often published in groups; up to ten attachments (photos, videos, audios) can be attached to one post on the wall. We can make an application for reading news feeds . We can store videos here - consider it a cinema in your pocket. Place your MP3 collections, store photos or just documents.

The main thing is to properly disguise the content from hunters of unlicensed content (encrypting files or their names). However, I am sure that you are not some kind of pirate and do not need such measures to protect your content ;). To summarize, using VK we can do:

  • news application;
  • online cinema;
  • online MP3 player;
  • own photo server;
  • Google Docs killer - MyVKDoc !

Excerpt from the official documentation: preparation for use

Before you start working with the VK SDK, you need to create a Standalone application on the application creation page. Save your application ID and fill in the fields “Package name for Android”, “Main Activity for Android”, “Certificate fingerprint for Android”.

Everything is clear with the keys and the Standalone application, but one caveat remains: the user on whose behalf we will publish posts on the wall must have the necessary rights in this group. This is configured in the “Community Management → Members” section. When first launched, the application must also request permissions (for example, VKScope.WALL, VKScope.DOCS ). They are specified in the VKSdk.login() .

If the official VK application is installed on the device, a window will appear asking:


Request from the official application
Other articles in the issue:

Xakep #210. A short excursion into Ethereum

  • Contents of the issue
  • Subscription to "Hacker" -30%
If there is no application, then we will see this fragment, requiring you to enter your login password:


Web request

Now we can directly access Android SDK without having to think about authorizations.

Then the next obstacle awaits us - you can upload no more than 50 posts per day to the group wall:

API errorVKError (code: 214; ; Access to adding post denied: you can only add 50 posts a day

In addition, if we load very quickly, the SDK will stop us with a captcha:


Not so fast, boy!

For me it came out after 20 documents downloaded in a row. The developers will not tell us the algorithm for the appearance of the captcha, either through friendship, or for money, or under torture. I've found out through experience that it's safe enough to add a new entry every 29 minutes . The captcha should not wake up from such a colossal speed, and we will also meet the limit of 50 downloads per day.

Rating
( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]