loading...
DotNek app development
DotNek بازدید : 115 چهارشنبه 19 خرداد 1400 نظرات (0)

There are several sites that users can use on a regular basis in order to get the answers to their questions, each of which has different appearances, which is what makes them attractive to different users, such as the virtual world where the user chooses a store, out of hundreds shops, due to the attractiveness of the shop design , as a site owner, in order to create an attractive design for your site , you need to increase your level of knowledge about CSS and learn the ways of choosing an attractive background for different pages, or you can use a readable and appropriate font in order to increase your site traffic , but before that we need to give you a brief and general explanation about CSS itself.

Learning Style Sheets, background, text and font in CSS

What is CSS?

CSS stands for Cascading Style Sheets which by being added to HTML through different methods, causes websites to be displayed in the best possible way, there are 3 ways to do this:

- External CSS:

By using this method, you can change the appearance of a site in the shortest time, it should be noted that, it is enough to change one of the files, which we will give you an example of it, in the following.

<! DOCTYPE html>

<html>

<head>

<link rel = "stylesheet" href = "mystyle.css">

</head>

<body>



<h1> This is a heading </h1>

<p> This is a paragraph. </p>



</body>

</html>

- Internal CSS:

This method should be used when a page has its own unique style, so that you cannot make a big change to it, in this case you can easily apply the desired changes through this method.

<! DOCTYPE html>

<html>

<head>

<style>

body {

background-color: linen;

}



h1 {

color: maroon;

margin-left: 40px;

}

</style>

</head>

<body>



<h1> This is a heading </h1>

<p> This is a paragraph. </p>



</body>

</html>

- Inline CSS:

In this method, it is also necessary to add the style attribute to the relevant element.

<! DOCTYPE html>

<html>

<body>



<h1 style = "color: blue; text-align: center;"> This is a heading </h1>

<p style = "color: red;"> This is a paragraph. </p>



</body>

</html>

CSS background:

Background in CSS has various features which are as follows: background-color, background-size, background-position, background-clip, background-image, background-size, background-repeat, background-origin, background-attachment, all of which will be explained briefly in the following.

- Background-color:

As its name implies, you can adjust the background colors with the help of this item, and it is necessary to be careful while choosing the right color, so you shouldn’t choose the color that makes the users not be able to use the website properly after a while, due to the fact their eyes will get tired of it.

body {background-color: white;}

- Background-size:

In order to adjust this item, you must specify the width and height, it is also possible to use the word “auto” in order to determine the size automatically, in addition, it is possible to use one of the items such as width and allow the length to be automatically determined.

background: url (hill.jpg);

background-repeat: no-repeat;

background-size: auto;

}

- Background-position:

As its name shows, it is used to set the background position, and you must use it to determine where the background should start, so you can use some words such as, left top, left center, left bottom, center top, etc., or use percentages, pixels and so on, in order determine the position of the background, there is an example of setting the background position for you.

body {

background-image: url ('HTML.gif');

background-repeat: no-repeat;

background-attachment: fixed;

background-position: bottom right;

}

Learning Style Sheets, background, text and font in CSS

- Background-image:

In order to set different photos in one element, you have to use this item.

body {

background-image: url ("img_ant.gif"), url ("book.gif");

background-color: #cccccc;

}

- Background-origin:

The background position area can be specified through this item.

{

border: 5px dashed white;

padding: 15px;

background: url (paper.gif);

background-repeat: no-repeat;

background-origin: content-box;

}

Text:

The text in a content is of a great importance for the user who visits your website, in CSS, the text is placed inside the content box of the element, this box should contain the desired text, also if you want to cut one of the lines, you need to use the
element, texts have the following characteristics:

- Font styles:

This feature is used to apply different properties to the font, for example, you may want to make the text lighter, smaller, etc., which you have to use some properties in order to achieve your goal.

- Text layout styles:

This feature is used to determine the distance between lines, words, etc., and sets all these items in the content box.

CSS font:

Font is also so important in designing a site , for instance, you can use a different font for a text which is more important, so that the users can notice its importance as soon as they see it, in order to aster this section, you must know font-style, font-variant, font-weight, font-family, font-size, etc., which we will explain a number of them in the following.

- font-style:

This item has different types that include, normal, italic, oblique, initial and inherit.

p.a {

font-style: normal;

}



p.b {

font-style: italic;

}



p.c {

font-style: oblique;

}

- font-variant:

This feature determines that the text should be written in uppercase or lowercase as well as their size.

p.small {

font-variant: small-caps;

}

- font-weight:

The size of different characters in the text is determined with the help of this item, this case has various properties that can be shown in the text with the help of the following values.

                 

Normal:

It is used to specify normal characters in the text.

Bold:

 It is used to indicate bold characters.

Lighter:

It defines lighter characters

100-900:

The numbers 100 to 900 are used to determine whether the characters are faint or bold, when a small number is used, it will be fainter, and the closer the number is to 900, the bolder it will be.

p.normal {

font-weight: normal;

}



p.thick {

font-weight: bold;

}



p.thicker {

font-weight: 800;

}

Another example:

p.normal {

font-weight: normal;

}



p.thick {

font-weight: bold;

}



p.thicker {

font-weight: 700;

}

- Font-size:

This item is used to determine the font size, which can be adjusted in different ways, for this setting, the following values must be used.

Medium:

This value is presented in font-size by default, and as its name implies, it has a medium size in that font.

xx-small

x-small

Small

Large

x-large

xx-large

Smaller

Larger

Length:

In this case, you have to adjust the font size in centimeters.

%:

In this case, the font size is determined as a percentage.

div.a {

font-size: 20px;

}



div.b {

font-size: x-large;

}



div.c {

font-size: 120%;

}

Another example:

div.a {

font-size: 40px;

}



div.b {

font-size: x-large;

}



div.c {

font-size: 150%;

}



Learning Style Sheets, background, text and font in CSS

Last word:

In general, website design should be one of the most important goals that every person has before creating a site , in order to create a site, you must have a lot of knowledge in this regard in order to be able to act correctly, the most important thing that can be used in site design is Cascading Style Sheets, in which different items can be used in order to design each item in a site, in this article, we have mentioned fonts, text, backgrounds, etc., which you can use to design a suitable and attractive site, and to design appearance of each character, letters, images, etc., you should use the available items.

Here we have tried to give examples of the ways of coding, and the ways of implementing the code, so that you can design a suitable site that attracts different users to the site which increases the traffic to the website , and the website ranking will increase as well, so that the site owners can see the result of their efforts and accuracy in creating the site and achieve success through this way, due to the fact that if you can attract more users, you will achieve your goal as soon as possible, because when your website is attractive enough, the users may decide to introduce your website to their friends, as a result, the number of your website users will increase day by day.

DotNek بازدید : 130 چهارشنبه 19 خرداد 1400 نظرات (0)

Play designing has a very important role in technology and entertainment today. In this article, we want to talk to you about the tools and game courses and tell you how you can increase your knowledge in game development by using the various courses that exist in this field. Note that in general there are many steps and actions in the field of designing a game . At the elementary level, you should try to master the skills of programming, getting acquainted with Photoshop software, having a lot of motivation and energy, and passing the game programming course, game design course, and game art course so that you can finally, design and produce a game. Note that there are different courses and stages for game making that you can use according to your taste from any of these courses that are available in various levels and sites to be able to develop your skills in making and producing games. These skills are held in many different types and different courses for those who are interested, and you can find the institute or site you want by researching in this field and spend your courses in them.

What are the best courses and tools for game development?

Steps to game development

After you have chosen your course and enrolled in the institute of your choice to take gaming courses, it is better to know some tips about the game programming process so that you can increase your knowledge in this field. In the following, we intend to fully name the stages of designing a game for you to more familiar with this stage.

First, raise your information

In the first step in designing game , you should be familiar with some of the terms that exist in this field so that you can have a better understanding of the purpose of game development.  You need to have answers to these questions such as why we play, how many games there are, what the style of computer games is, what hardware is needed to run the game, and who the game maker is, when you can answer these questions, you can grow higher in the field of game coding and its goals. Note that games today are not just entertainment, and the gaming industry has the potential to become one of the largest and most lucrative industries in the world, so you should try to get all the information you need about gaming so you can have a comprehensive and complete view of the world of games and designing the game so that you can be more successful in this field and can produce appropriate games.

The second step is to introduce the resources

Before you start making games , try to get comprehensive and complete information about playing methods.  Try to participate in different workshops for gaming so that you can see the training required for gaming. One of the different and appropriate resources to get help in gaming is the Internet.  You can learn anything you want on the internet. When playing games, if you have a problem, try to search all your questions on the Internet so that you cannot only add to your knowledge but also solve your problems. Note that not everything that is said on the Internet is true, so try to use the highest quality sites and make sure that the information you receive is correct so that, God forbid, there are no special problems for you in this area and you can build your own game without any problems.  There are also various articles in this field that you can play according to these items.

The third step is to introduce the steps and tools of game designing

After you have mastered the basics of gaming, the third step you should have a complete view of the game you are designing . For example, you need to specify your goal of producing the game , the required and available budget and time, form your team and document, choose the game engine, and test the market. So, after you get the comprehensive information about the designing game, in the third step you have to figure out all these issues for yourself to understand what you are going to do. You need to define your purpose for making the game, for example, some games are made for material, educational, experimental, etc. purposes so you must always have comprehensive information about the game you are making. Once you have defined your goal, you need to know how much budget and time you have to produce, and then you need to determine your team and get help from people who specialize in these areas, and by choosing the right game engine , build yourself a game with the highest quality.

Steps to game development

Conclusion

In this article, we have tried to talk to you about the courses and stages of making a game, we have tried to tell you tips so that you can get information about the development of games by paying attention to these points. Note that you have to take a certain amount of time to learn gaming courses, and it is better to get information about the time of the company before taking these courses. For example, you need at least two weeks to learn the basics of the game as well as the conceptual parts of the game. You should take at least a month to learn how to use the game engine and programming engine, and fifteen days to master graphic related tools such as Photoshop, etc., and after these courses, you will need one month to be able to  Create a basic mini-game so that in this mini-game you can realize your strengths and weaknesses. Note that making a mini-game helps you to produce the game according to your abilities and creativity and get to know your strengths and weaknesses. It will also help you to strengthen your strengths and try to overcome your weaknesses.

DotNek بازدید : 124 چهارشنبه 19 خرداد 1400 نظرات (0)

It should be noted that the search process can be different in different sections. In this case, the search results can be displayed to the user from the server, application , system, device, etc. Therefore, the user can easily perform the search operation according to his needs and then receive the related results. In this part of the tutorial, we want to talk about searchview android and search operations.

How to work with searchview on Android systems and perform search operations

What he learns in this section is as follows:

- What is searchview android ?

- How to build and run a searchview android project in Android Studio - How to add a searchview to the toolbar

- searchview in actionbar android example

What is Searchview?

searchview android is another widget that exists in Android and the user can use it to search for one or more phrases and view the results there. searchview android is actually a bar that is used to perform the search process, in which the user searches for the words or phrases he wants there and sees the results.

1- I create a project in Android Studio and name it SearchView as desired.

2- The type of activity used in this training is Empty Activity.

3- It should be noted that the language required for this project is Java.

4- In the activity layout, we add a ListView and SearchView.

5- The codes that should be in the activity_main.xml section are as follows:

<? xml version = "1.0" encoding = "utf-8"?>
<RelativeLayout
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
tools: context = ". MainActivity">

<ListView
android: id = "@ + id / list_view"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: divider = "# BCBCBC"
android: dividerHeight = "1dp"
android: layout_below = "@ id / search_view" />

<SearchView
android: id = "@ + id / search_view"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: queryHint = "Search ..."
android: iconifiedByDefault = "false"
android: layout_alignParentTop = "true" />

</RelativeLayout>

In the code above, the queryHint feature is used to add help, and the iconifiedByDefault feature is used to display search options. A false value is set for the second attribute, which ultimately causes the widget not to be an icon but also to have a search box. Note that if we set the value of the second attribute to true, it will cause the search box not to be displayed and only a magnifying glass icon to be displayed.

6- Define two widgets in an activity and create a list that includes the names of several cities.

7- The codes that should be in the MainActivity.java section are as follows:

package ir. android_studio. SearchView;

import androidx.appcompat.app. AppCompatActivity;
import android.os. Bundle;
import Android.Widget. ArrayAdapter;
import Android.Widget. ListView;
import android. widget. SearchView;
import java. util. ArrayList;

public class MainActivity extends AppCompatActivity {

SearchView;
ListView;
ArrayList list;
ArrayAdapter adapter;

@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);

searchView = findViewById (R.id. search_view);
listView = findViewById (R.id. list_view);

list = new ArrayList <> ();
list.add ("Istanbul");
list.add ("Los Angles");
list.add ("Frankfurt");
list.add ("Paris");
list.add ("Vienna");
list.add ("Belgium");
list.add ("New York");

adapter = new ArrayAdapter <String> (this, android.R. layout. simple_list_item_1, list);
listView.setAdapter (adapter);

}
}

How to work with searchview on Android systems and perform search operations

By inserting the above code, we have created a list that contains the values ​​of the city names, which is set on ListView using setAdapter ().

In the next steps we need to create a Listener for SearchView. By creating a listener, we enable the user to check the input and provide the appropriate and related result.

8- To do this, use the setOnQueryTextListener method.

9- I define the method inside the onCreate () activity. Like the following:

searchView. SetOnQueryTextListener (new SearchView.OnQueryTextListener () {
@Override
public boolean onQueryTextSubmit (String s) {
return false;
}

@Override
public boolean onQueryTextChange (String s) {
return false;
}
});

It should be noted that this method itself has two methods, onQueryTextSubmit () and onQueryTextChange (), which are automatically added by Android Studio .

Both methods are boolean, in other words, the values ​​that can be placed in these methods are false or true.

10- We complete the methods as follows:

searchView. SetOnQueryTextListener (new SearchView.OnQueryTextListener () {
@Override
public boolean onQueryTextSubmit (String s) {

if (list. Contains (s)) {
adapter. get Filter (). filter (s);
} else {
Toast.makeText (MainActivity.this, "Item not found", Toast.LENGTH_LONG). show ();
}

return false;
}

@Override
public boolean onQueryTextChange (String s) {

adapter. get Filter (). filter (s);

return false;
}
});

By entering the above code, the characters entered by the user are stored in a String named s.

In the code above, we have defined a condition for onQueryTextSubmit to check whether the value entered by the user stored in s is in the list.

In other words, the strings stored in s are set by the adapter in listView.

adapter. get Filter (). filter (s);

How to work with searchview on Android systems and perform search operations

get Filter () also filters the options in the list and removes the rest of the items in the list. However, if the characters entered by the user do not match the items in the list, a toast will be displayed indicating that the item was not found.

But it should be noted that in onQueryTextChange we have defined a condition that checks the user input characters and adds to the list if it is not in the list. This means that if the item that the user is looking for is not in the list, it should be added to the list:

11- The complete code that should be included in MainActivity.java is as follows:

package ir. android_studio. SearchView;

import androidx.appcompat.app. AppCompatActivity;
import android.os. Bundle;
import Android.Widget. ArrayAdapter;
import Android.Widget. ListView;
import android. widget. SearchView;
import android. widget. Toast;

import java. util. ArrayList;

public class MainActivity extends AppCompatActivity {

SearchView;
ListView;
ArrayList list;
ArrayAdapter adapter;

@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);

searchView = findViewById (R.id. search_view);
listView = findViewById (R.id. list_view);
list = new ArrayList <> ();
list.add ("Istanbul");
list.add ("Los Angles");
list.add ("Frankfurt");
list.add ("Paris");
list.add ("Vienna");
list.add ("Belgium");
list.add ("New York");
adapter = new ArrayAdapter <String> (this, android.R. layout. simple_list_item_1, list);
listView.setAdapter (adapter);

searchView. SetOnQueryTextListener (new SearchView.OnQueryTextListener () {
@Override
public boolean onQueryTextSubmit (String s) {

if (list. Contains (s)) {
adapter. get Filter (). filter (s);
} else {
Toast.makeText (MainActivity.this, "Item not found", Toast.LENGTH_LONG). show ();
}

return false;
}

@Override
public boolean onQueryTextChange (String s) {

adapter. get Filter (). filter (s);

return false;
}
});

}
}

12- We will implement the project.

13- Enter the letter "I" to test. We see that it displays the corresponding value.

Add SearchView to the toolbar

In this part of the tutorial, we want to enter SearchView into the toolbar and display it there.

1- To do this, we must first create a menu directory.

2- Then add the xml file to it. It should be noted that the name of this file has been chosen arbitrarily in this tutorial, toolbar_searchview.

3- In the menu, we define an item like the following.

4- The code that should be in the toolbar_searchview.xml file is as follows:

<? xml version = "1.0" encoding = "utf-8"?>
<menu xmlns: app = "http://schemas.android.com/apk/res-auto"
xmlns: android = "http://schemas.android.com/apk/res/android">

<item
android: id = "@ + id / toolbar_search"
android: icon = "@ drawable / ic_search"
android: title = "Search"
app: showAsAction = "ifRoom | with Text"
app: actionViewClass = "android. widget. SearchView" />

</menu>

In the codes listed above, we add a magnifying glass icon to the drawable folder of the project by default from the icons of Android Studio Assets Studio.

5- In the next step, after the onCreate () method and in the Activity class, I add the onCreateOptionsMenu () method. Like the following:

@Override
public boolean onCreateOptionsMenu (Menu menu)
return super. onCreateOptionsMenu (menu);
}

6- Then we complete the method as follows:

@Override
public boolean onCreateOptionsMenu (Menu menu) {

Menu Inflater = getMenuInflater ();
inflater. inflate (R. menu. Toolbar_searchview, menu);
final SearchView toolbar_searchview =
(SearchView) menu. findItem (R.id. toolbar_search). g Search");
toolbarSearchView.setIconifiedByDefault (true);

searchView. SetOnQueryTextListener (new SearchView.OnQueryTextListener () {
@Override
public boolean onQueryTextSubmit (String s) {

if (list. Contains (s)) {
adapter. get Filter (). filter (s);
} else {
Toast.makeText (MainActivity.this, "Item not found", Toast.LENGTH_LONG). show ();
}

return false;
}

@Override
public boolean onQueryTextChange (String s) {
adapter. get Filter (). filter (s);
return false;
}
});

return super. onCreateOptionsMenu (menu);
}

After inflating the menu, we created a SearchView with the desired toolbar_searchview name, which is linked to the menu item.

Then we use the setQueryHint and setIconifiedByDefault methods, the first method adds a Hint and the second method because it is true, only the magnifying glass icon is displayed and the search box is not displayed.

7- Then, we run the project.

8- We will see that an icon has been added to the toolbar, which by clicking on it, the search box will be added, and you can easily use it to perform search operations.

9- Note that if we set setIconifiedByDefault to false, the search box will be displayed by default.

10- In this part of the simple mode tutorial, we reviewed and created a searchview android example.

11- The complete and final code that should be in the MainActivity.java section are as follows:

package ir. android_studio. SearchView;

import androidx.appcompat.app. AppCompatActivity;
import android.os. Bundle;
import android. view. Menu;
import android. view. Menu Inflater;
import Android.Widget. ArrayAdapter;
import Android.Widget. ListView;
import android. widget. SearchView;
import android. widget. Toast;

import java. util. ArrayList;

public class MainActivity extends AppCompatActivity {

SearchView;
ListView;
ArrayList list;
ArrayAdapter adapter;

@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);

searchView = findViewById (R.id. search_view);
listView = findViewById (R.id. list_view);

list = new ArrayList <> ();
list.add ("Istanbul");
list.add ("Los Angles");
list.add ("Frankfurt
");
list.add ("Paris");
list.add ("Vienna");
list.add ("Belgium");
list.add ("New York");
adapter = new ArrayAdapter <String> (this, android.R. layout. simple_list_item_1, list);
listView.setAdapter (adapter);

searchView.setOnQueryTextListener (new SearchView.OnQueryTextListener () {
@Override
public boolean onQueryTextSubmit (String s) {

if (list. contains (s)) {
adapter. getFilter (). filter (s);
} else {
Toast.makeText (MainActivity.this, "Item not found", Toast.LENGTH_LONG). show ();
}

return false;
}

@Override
public boolean onQueryTextChange (String s) {

adapter. getFilter (). filter (s);

return false;
}
});
}

@Override
public boolean onCreateOptionsMenu (Menu menu) {

MenuInflater mInflater = getMenuInflater ();
mInflater.inflate (R. menu. toolbar_searchview, menu);
final SearchView toolbarSearchView = (SearchView) menu. findItem (R.id. toolbar_search). getActionView ();
toolbarSearchView.setQueryHint ("Search");
toolbarSearchView.setIconifiedByDefault (true);

toolbarSearchView.setOnQueryTextListener (new SearchView.OnQueryTextListener () {
@Override
public boolean onQueryTextSubmit (String s) {

if (list. Contains (s)) {
adapter. get Filter (). filter (s);
} else {
Toast.makeText (MainActivity.this, "Item not found", Toast.LENGTH_LONG). show ();
}

return false;
}

@Override
public boolean onQueryTextChange (String s) {
adapter. get Filter (). filter (s);
return false;
}
});

return super. onCreateOptionsMenu (menu);
}
}

How to work with searchview on Android systems and perform search operations

In this tutorial, you learned how to check and create a searchview android example, and you were able to make settings related to it.

DotNek بازدید : 122 چهارشنبه 19 خرداد 1400 نظرات (0)

These days, users spend a lot of time on the Internet throughout the day and night in order to do all their daily tasks through it, with the release of the latest version of HTML , users gained a better experience of using the Internet, and the reason for this positive user experience was the ability to add high quality videos, audio and images through this way, in order to be able to add them to a website , you need to enter code, which we are going to mention briefly below.

In general, these days, most owners of large and small sites use HTML5 , therefore they are able to attract different users to their websites, and eventually users recommend these sites to their friends, thus it causes an increase in the traffic and ranking of the website , which causes the site to appear in the first page of search engine results page which can have a huge impact on the success of a website.

Learn how to add audio and video in HTML5

How to embed audio files?

With the help of HTML5 you can do this task easily, but it should be noted that it is necessary to specify the source, and you also need to embed the control feature in it, so that the user who is using that audio can play or pause it, audio formats may be Ogg, mp3, wav, and so on, which are not specified in the HTML5 draft, but these three audio formats are supported in HTML.

The

There are various browsers such as Chrome, Firefox, Safari, Opera, etc., all of which support all three audio formats mentioned above, except for Safari, which does not support OGG format, but it supports two other audio formats.

These audio files have features such as autoplay, autobuffer, controls, loop, muted, preload, src, which we will briefly explain about each of them in the following.

Autoplay:

As you know, this feature detects that the sound should be played as soon as it is ready.

<audio scc = “sound.mp3” autoplay = ”autoplay”>

browser does not support the audio element

</audio>

Controls:

This feature also allows the user to view control buttons such as play, pause, etc., and use them if needed.

Loop:

Through this way, whenever the audio ends, it starts playing again from the beginning and the file can be heard by users repeatedly, the use of this adjective is as follows:

<audio src = “sound.mp3” loop = ”loop”>

browser does not support the audio element

</audio>

Learn how to add audio and video in HTML5

Muted:

 it indicates that it should be silent and no sound should be heard.

Preload:

When you refer to a site that has audio files, it is the site owner who determines whether the audio file is included in the content, should be downloaded at the same time as loading the page or not, in the following part we are going to show you the way it works.

<audio src = “sound.mp3” preload = “auto”>

browser does not support the audio element

</audio>

Autobuffer:

If the file does not be played automatically, the autobuffer will be started automatically by installing this feature.

Src:

The most important feature of a Src tag is that it specifies the address of the audio file, so that the browser can use it.

<audio src = “sound.mp3”>

browser does not support the audio element

</audio>

In general, adding an audio file may be done as follows:

<! DOCTYPE HTML>

<html>
<body>

<audio controls autoplay>
<source src = "/html5/audio.ogg" type = "audio / ogg" />
<source src = "/html5/audio.wav" type = "audio / wav" />
Your browser does not support the <audio> element.
</audio>

</body>
</html>

How to embed a video?

By adding videos to various contents, especially educational content, users can gain a positive user experience and ultimately make the best use of the web , and it should be noted that video has more features than audios, due to the fact that Video is visual unlike audio, which is the reason why it has more features such as poster, length and width in addition to audio file ones.

Users may try to visit the site through various devices and then view the video, so HTML5 can be considered as a great help to site owners, so that users with any device can get a positive user experience from using the site, we will briefly explain each of the features in the following.

Length and width:

The size of the videos is very important, and you can use CSS to control this size, a feature that all of them must maintain properly is the ratio between length and width which is called the aspect ratio, and this is very important.

Poster:

This feature shows an image before the video is played, which its attractiveness is of a great importance, due to the fact that different users may be attracted to the video and click on it after seeing the attractive poster, so it is necessary to choose a good image as the poster for your work.

Video files also come in a variety of formats, including mpeg4 and Ogg, the most important feature of image files like audio files, is the source, which is necessary to be properly specified in the tag, and browsers try to use the first format they identify, by seeing the source.

Adding an image file may be done as follows:

<! DOCTYPE HTML>

<html>
<body>

<video width = "400" height = "300" controls autoplay>
<source src = "/html5/foo.ogg" type = "video / ogg" />
<source src = "/html5/foo.mp4" type = "video / mp4" />
Your browser does not support the <video> element.
</video>

</body>
</html>



 - HTML5 player libraries:

These players are implemented with JavaScript, in fact, they make more compatibility between different browsers, so that they can provide the user with video which contains more features and better quality, for example, one of the features that can be supported which may not be supported in some browsers is a subtitle that can cause the user to have a very positive user experience by watching the video, in addition to the points which have been mentioned above, JavaScript can provide many features that browsers may or may not support, all of which can significantly improve the quality of video.

Important note:

As mentioned before, all browsers may not support all audio and video formats, so you should use the following trick to give this opportunity to the users who visit your site with any browser and play the video or audio file, to be able to achieve their goal and meet their needs as well, for example, in the case of audio files that as you know they have two formats, you can use the following trick.

<"audio controls =" controls

</ "source src =" song.ogg "type =" audio / ogg>

</ "source src =" song.mp3 "type =" audio / mpeg>

Your browser does not support the audio element

<audio />

In this example, we have provided the source tag twice in both available formats, so that the browser shows the file which is able to play, and when neither MPEG nor OGG can be supported by the browser, a text will be displayed to the user including the sentence that your browser does not support the audio element.

Learn how to add audio and video in HTML5

Last word:

In general, HTML5 made a huge change in the world of the Internet, it allows users to get a better user experience from various websites, especially the ones that have educational contents, all of which can be used with the help of adding this version of audio and video files to the content, in this article, we tried to explain to you the ways of embedding audio and video files, and we also explained the different features that each one has, so that you can use the given information in order to create different contents for your website and attract more users to it .

DotNek بازدید : 105 چهارشنبه 19 خرداد 1400 نظرات (0)

Bitmaps used to specify the resolution of different types of images can be stored under the -mdpi, -hdpi, -xhdpi, -xxhdpi folders, whose parent folder is also res / drawable . Each Drawable is stored as a separate file inside the res / drawable folders. In this tutorial we will talk about what Drawables are and what they are used for and how they can be used in Android .

What are drawable in applications and how can they be designed?

Use drawables

To be able to access and use Drawables, we can act as a @drawable / filename. In this case, instead of filename, we must write the name of the file we want to access. It should be noted that the file name must be entered without an extension, if the file we want to access has an extension, the extension must be removed. For example, suppose we want to access the res / drawable / test.png file, in which case we have to do this @ drawable / test and delete the last extension, which is png.

like the:


<Textview xmlns: android = "http://schemas.android.com/apk/res/android"
Android: id = "@ + id / textView1"
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: background = "@ drawable / hello"
Android: text = "@ string / hello_world" />

It is also worth mentioning that by using codes and through coding, Drawable can be assigned and connected to Views. Because all views accept the resource ID in front of each input parameter.

Below is the code that can show how to draw Drawables as a background to ImageView:

ImageView = (ImageView) findViewById (R.id. image);

ImageView.setImageResource (R. drawable. hello);

This code specifies how to connect the Drawable as a background or ImageView.

How to load Bitmap

Android offers the Bitmap class to be able to work with bitmaps. So it can be said that the Bitmap class was created to be able to use bitmaps. In this part of the tutorial we want to teach you how to convert Bitmap objects to Drawable or vice versa.

Note that you can even load bitmap files and then convert them to Drawable objects .

Below is a code that shows how to create a Bitmap object in the assets folder and assign it to ImageView. The code below can then create the Bitmap object inside the assets folder and assign it to ImageView.


// Get the AssetManager
AssetManager manager = getAssets ();
// read a Bitmap from Assets
InputStream open = null;
try {
open = manager. open ("logo.png");
Bitmap = BitmapFactory.decodeStream (open);
// Assign the bitmap to an ImageView in this layout
ImageView view = (ImageView) findViewById (R.id. imageView1);
view. setImageBitmap (bitmap);
} catch (IOException e) {
e. printStackTrace ();
} finally {
if (open! = null) {
try {
open. close ();
} catch (IOException e) {
e. printStackTrace ();
}
}
}

Another way is to access Drawables through the res / drawable folder. In fact, in this method of accessing Drawables, they can be used as Bitmaps within the source code.

The code below can clearly show this process:

Bitmap b = BitmapFactory.decodeResource (getResources (), R. drawable.ic_action_search);
You can create a scale bitmap based on new definitions such as height or weight.
Bitmap originalBitmap = <initial setup>;
Bitmap resizedBitmap =
Bitmap.createScaledBitmap (originalBitmap, newWidth, newHeight, false);

To be able to convert the Bitmap object to Drawable, you can use the following code:


# Convert Bitmap to Drawable
Drawable d = new BitmapDrawable (getResources (), bitmap);

The code below can be used when you want to convert Bitmap objects to Drawable . So when you want to do this and convert Bitmap objects to Drawable, you can use the code listed above.

What is Shape Drawable?

Shape Drawables are actually XML files that allow programmers and developers to use geometric objects, colors, gradients, and other elements to draw a shape and place it in Views. The advantage of using drawable is that it can be automatically adjusted to the defined size.

Below is a code that is an example of a drawable:


<? xml version = "1.0" encoding = "UTF-8"?>
<shape xmlns: android = "http://schemas.android.com/apk/res/android"
android: shape = "rectangle">
<stroke android: width = "2dp"
android: color = "# FFFFFFFF" />
<gradient android: endcolor = "# DDBBBBBB"android: startcolor = "# DD777777"
android: angle = "90" />
<corners android: bottomrightradius = "7dp"
android: bottomleftradius = "7dp"
android: topleftradius = "7dp"
android: toprightradius = "7dp" />
</shape>

It should be noted that you have this possibility and you can assign the desired drawable to the background property of your page or layout. In other words, drawables can be placed on pages as background property.

<? xml version = "1.0" encoding = "utf-8"?>
<linearlayout xmlns: android = "http://schemas.android.com/apk/res/android"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: background = "@ drawable / myshape"
android: orientation = "vertical">
<edittext android: id = "@ + id / editText1"
android: layout_width = "match_parent"
android: layout_height = "wrap_content">
</edittext>
<radiogroup android: id = "@ + id / radioGroup1"
android: layout_width = "match_parent"
android: layout_height = "wrap_content">
<radiobutton android: id = "@ + id / radio0"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: checked = "true"
android: text = "@ string / celsius">
</radiobutton>
<radiobutton android: id = "@ + id / radio1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "@ string / fahrenheit">
</radiobutton>
</radiogroup>
<button android: id = "@ + id / button1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "@ string / calc"
android: onclick = "myClickHandler"> </button>
</linearlayout>

What is State Drawable?

State Drawable can actually help the programmer by describing the situation. In this way, it can explain the desired situation to the programmer and inform him of these situations. Note that each position has a separate drawable inside the View.

Below is the code that can define the unique drawable button according to the situation:

<? xml version = "1.0" encoding = "utf-8"?>
<selector xmlns: android = "http://schemas.android.com/apk/res/android">
<item android: drawable = "@ drawable / button_pressed"
android: state_pressed = "true" />
<item android: drawable = "@ drawable / button_checked"
android: state_checked = "true" />
<item android: drawable = "@ drawable / button_default" />
</selector>
Transition Drawable
Using Transition Drawable, you can enable, define and adjust Transition effects and use them to enhance and beautify your appearance.
<? xml version = "1.0" encoding = "utf-8"?>
<transition xmlns: android = "http://schemas.android.com/apk/res/android">
<item android: drawable = "@ drawable / first_image" />
<item android: drawable = "@ drawable / second_image" />
</transition>
final ImageView image = (ImageView) findViewById (R.id. image);
final ToggleButton button = (ToggleButton) findViewById (R.id. button);
button. setOnClickListener (new OnClickListener () {
@Override
public void onClick (final View v) {
TransitionDrawable drawable = (TransitionDrawable) image. getDrawable ();
if (button. is Checked ()) {
drawable. startTransition (500);
} else {
drawable. reverseTransition (500);
}
}
});

By entering this code, you can easily activate the Transition effect and use it.

 Vector drawables

Android provides the ability to define and adjust Vector drawables for programmers, and programmers can use this feature. The advantage of using Vector drawables is that it calculates the drawable scale according to the device density and makes them adjust automatically.
<Vector xmlns: android = "http://schemas.android.com/apk/res/android"
Android: height = "64dp"
Android: width = "64dp"
Android: viewport height = "600"
Android: viewport width = "600">
<Group
android: name = "rotationGroup"
Android: pivotx = "300.0"
Android: pivoty = "300.0"
Android: rotation = "45.0">
<Path
android: name = "v"
Android: fillcolor = "# 000000"
Android: pathdata = "M300,70 l 0, -70 70,70 0,0 -70,70z" />
</group>
</vector>

The code is inserted to show Vector drawables, which can calculate the scale of drawables based on the density of the device.

It should also be noted that higher versions of Android, such as version 5.0, also have the AnimatedVectorDrawable feature, which allows you to combine vector drawable with animations.

Animation Drawables

As explained above, we can also design Animation Drawables and import Animations into Vector drawables. In this case using the setBa methodckgroundResource () We can call the designed Animation Drawables and put them in the View and assign them.

<! - Animation frames are phase * .png files inside the
Res / drawable / folder ->
<Animation-list android: id = "@ + id / selected" android: oneshot = "false">
<Item android: drawable = "@ drawable / phase1" android: duration = "400" />
<Item android: drawable = "@ drawable / phase2" android: duration = "400" />
<Item android: drawable = "@ drawable / phase3" android: duration = "400" />
</animation-list>
ImageView img = (ImageView) findViewById (R.id. your id);
Img.setBackgroundResource (R. drawable. your_animation_file);
// Get the AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img. getBackground ();
// Start the animation (looped playback by default).
FrameAnimation.start ();

The code listed above designs an Animation Drawables, calls it using the setBackgroundResource () method, and finally assigns it to the Views.

Patch Drawable

Patch Drawables are actually bitmaps that can be used to measure images, or otherwise can be considered to have some stretchable areas, in which case it can be easily resized, small Kurd or magnified. If the size and scale of the image is not equal to the size and scale of the Drawable, you can change the size of the image to the Drawable size using the stretchable areas from the top and left.

The question may be asked why it can only be resized, enlarged or reduced from the top left? The answer is that the other parts, the bottom and the right can also be used to write and insert text. This is the case where you want to write text inside the Drawable and display it in the view.

A set of programming tools that can use the ADT process in Android are located in the android-sdk / tools installation folder.

How to create a custom Drawable?

In addition to Drawables, custom Drawables can also be used. Drawables that are proprietary can be used with Canvas and can also be customized to suit your needs.

1- Create a project based on the Empty Activity template.

2- Project names have been selected in this tutorial com. vogella. android. drawables. custom.

3- Then create the Drawable custom class.

package com. vogella. android. drawables. custom;
import android. graphics. Bitmap;
import android. graphics. BitmapShader;
import android. graphics. Canvas;
import android. graphics. ColorFilter;
import android. graphics. Paint;
import android. graphics. PixelFormat;
import android. graphics. RectF;
import android. graphics. Shader;
import android. graphics. drawable. Drawable;
public class MyRoundCornerDrawable extends Drawable {
private Paint;
public MyRoundCornerDrawable (Bitmap bitmap) {
BitmapShader shader;
shader = new BitmapShader (bitmap, Shader.TileMode. CLAMP,
Shader.TileMode. CLAMP);
paint = new Paint ();
paint. setAntiAlias (true);
paint. setShader (shader);
}
@Override
public void draw (Canvas canvas) {
int height = getBounds (). height ();
int width = getBounds (). width ();
RectF rect = new RectF (0.0f, 0.0f, width, height);
canvas. drawRoundRect (rect, 30, 30, paint);
}
@Override
public void setAlpha (int alpha) {
paint. setAlpha (alpha);
}
@Override
public void setColorFilter (ColorFilter cf) {
paint. setColorFilter (cf);
}
@Override
public int getOpacity () {
return PixelFormat.TRANSLUCENT;
}
}

4- Now in order to be able to use the class you created above, you need to configure your layout file as below

Now if you want to use the class you created above, you have to make the layout settings as below. In this case, you need to make sure that the settings you made in the layout section are as follows or not.

Use drawables

<relativelayout xmlns: android = "http://schemas.android.com/apk/res/android"
Xmlns: tools = "http://schemas.android.com/tools"
Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Tools: context = ". MainActivity">
<Imageview
android: id = "@ + id / image"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: layout_centerhorizontal = "true"
Android: layout_centervertical = "true"
Android: contentdescription = "TODO" />
</relativelayout>

Set the MainActivity class.

In order to be able to use the code listed below, you must create a file called dog.png inside the drawable folder and put the code listed below inside the file.

package com. vogella. android. drawables. custom;
import java.io. InputStream;
import android.app. Activity;
import android. graphics. Bitmap;
import android. graphics. BitmapFactory;
import android.os. Bundle;
import android. view. Menu;
import android. widget. ImageView;
public class MainActivity extends Activity {
@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);
ImageView button = (ImageView) findViewById (R.id. image);
InputStream resource = getResources (). OpenRawResource (R.drawable.dog);
Bitmap = BitmapFactory.decodeStream (resource);
button. setBackground (new MyRoundCornerDrawable (bitmap));
}
}

In this part of the tutorial you will learn what drawables are and what they can be used for. Did you know that drawables for images and their scales can be very effective and can be used to adjust them?

DotNek بازدید : 104 چهارشنبه 19 خرداد 1400 نظرات (0)

If you are also curious to know more about these games, follow us to the end of the article. We will talk more about this topic in the following.

Introducing Top 8 Action games on mobile app stores.

Top 8 Action games

Among computer games, action games have a special place. this games usually have a lot of fans because of the excitement they convey to the players. We can hardly have a ranking for the most popular action type of games; However, we want to talk to you about some of the most famous games and we have a description for you about them. Today, many games are made in the action style. In general, all of these games are the same, but in terms of space and stages, these games can be different from each other. This kind of games have a very wide range of games, and many of them, such as PUBG and Call of Duty, as well as Fortnite, are among the most popular games, and most of the action-designed games are also played online. Some of them do not require the internet and you can play them offline.

1. Fortnite

One of the most popular games in action category is Fortnite. The style of this game is action style and Battle Royale and is suitable for adults. This game after being very successful on various platforms such as PlayStation 4 and Xbox , its designers decided to release a mobile version of the game as well. It is interesting to know that the mobile version of this game also had a very good performance and was able to attract the attention of many players. This is a very attractive game that takes every player to its fantasy world. This game can be played in multiplayer.

2. Call of Duty

The style of this game is first-person and Battle Royale and it is a very suitable game for adults. Many people are fans of this game and are interested in playing this game. This game was able to become the most downloaded action game is this game, which is also known as one of the best action types of games. The game was able to attract a lot of players when it was released and still has a lot of fans. The story of this game tells the story of World War II that you have to control the main character of this story and with the help of various squads you have to fight the Nazis. This game is a full-fledged action game in which, in addition to killing the Nazis, you must be aware of people's health.

7. Marvel Future Fight

This game has action and role-playing style that, as its name suggests, runs in the world of Marvel movies and comics. This game is one of the most famous games in the category of action type of games. In this game, you compete competitively with artificial intelligence, and the gameplay is such that you must win each stage by selecting several heroes and using the unique powers that each of them has. This game has attracted the attention of many Marvel fans and introduced them to the world of Marvel. Note that this game has a similar storyline to Marvel movies, and this has made this game even more exciting.

Top 8 Action games

8. World of Tanks Blitz

Another action game is this game, which we can recognize as one of the best online games. This game can also compete with many popular online console games, which shows that this game is exciting and amazing. The name of this game dates back to World War II, and during the game, players have to compete with each other by controlling different types of tanks. This game is very popular and is known as one of the most popular mobile games . The game also has great graphics that make it one of the most popular games.

DotNek بازدید : 130 سه شنبه 18 خرداد 1400 نظرات (0)

The addition of new features and capabilities increases the use of the operating system and improves their performance . For example, in version 3.0, the Android operating system supports dynamic views and has the ability to display them. As the version of operating systems increases, other new features are added to them. Dynamics allows users to easily identify object properties over specific time periods and modify them as needed. In this tutorial we will talk about different types of dynamic display capabilities in the Android operating system .

The API allows the programmer to set a start value and an end value for the object properties at specified intervals, and can also apply timing changes to the attribute. It should be noted that this API can be used for different types of objects and is not intended only for views.

The parent class, also known as the superclass, is also the Animation API of the Animator class. The ObjectAnimator class is used to define and modify the properties of objects.

It is also possible for the programmer to add an AnimatorListener class to the Animator senior class. Listener can also be called in the animation and animation stages.

ViewPropertyAnimator

It should be noted that using the ViewPropertyAnimator class, which first appeared in version 3.1 of the Android operating system, can access the animations that exist at the view level.

The ViewPropertyAnimator object in a view can be returned by the animate () function. This object can enable animations to be performed simultaneously. It also has an API that enables the programmer to set the animation time.

The task of the ViewPropertyAnimator class is to provide an API for dynamic views.

The code below shows its use.

// Using hardware layer
myView.animate (). translationX (400). withLayer ();
ViewPropertyAnimator can be enabled to use a hardware layout to optimize performance and improve performance.
// Using hardware layer
myView.animate (). translationX (400). withLayer ();
Runnable should be set directly so that it can run both at the beginning and end of the dynamic view.
// StartAction
MyView.animate (). TranslationX (100). withStartAction (new Runnable () {
Public void run () {
Viewer.setTranslationX (100-myView.getWidth ());
// do something
}
});
// EndAction
MyView.animate (). Alpha (0). withStartAction (new Runnable () {
Public void run () {
// Remove the view from the layout called parent
Parent.removeView (myView);
}
});

setInterpolator () allows you to create a TimeInterpolator object. The standard procedure in this section is linear. In this AccelerateDecelerateInterpolator, the speed is initially low and increases slightly in the middle and then decreases again at the end.

Enable the LayoutTransition class on layout changes.

Like the following:

package com.example. android. layoutanimation;
import android. animation. LayoutTransition;
import android.app. Activity;
import android.os. Bundle;
import android. view. Menu;
import android. view. View;
import android. view. ViewGroup;
import android. widget. Button;
public class MainActivity extends Activity {
private ViewGroup;
@Override
public void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. activity_main);
LayoutTransition l = new LayoutTransition ();
l.enableTransitionType (LayoutTransition.CHANGING);
viewGroup = (ViewGroup) findViewById (R.id.container);
viewGroup.setLayoutTransition (l);
}
public void onClick (View view) {
viewGroup.addView (new Button (this));
}
@Override
public boolean onCreateOptionsMenu (Menu menu) {
getMenuInflater (). inflate (R. menu. activity_main, menu);
return true;
}
}
Use animation during the transition between activities
Animations can be applied in views or during the transition between activities.
The ActivityOptions class allows you to define and implement custom or default animations.

public void onClick (View view) {
Intent = new Intent (this, SecondActivity.class);
ActivityOptions options = ActivityOptions.makeScaleUpAnimation (view, 0,
0, view.getWidth (), view.getHeight ());
startActivity (intent, options.toBundle ());
}

view animation

In this section we will tell you how to use the Properties Animation API .

1- Create a new project called com. vogella. android. animation. views.

2- It is better to create a project with an activity called AnimationExampleActivity.

3- The layout file name should be main.xml.

4- Change the said file like the codes inserted below.

<? xml version = "1.0" encoding = "utf-8"?>

<relativelayout xmlns: android = "http://schemas.android.com/apk/res/android"

android: id = "@ + id / layout"

android: layout_width = "match_parent"

android: layout_height = "match_parent"

android: orientation = "vertical">

<linearlayout android: id = "@ + id / test"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content">

<button android: id = "@ + id / Button01"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content"

android: onclick = "startAnimation"

android: text = "Rotate" />

<button android: id = "@ + id / Button04"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content"

android: onclick = "startAnimation"

android: text = "Group"> </button>

<button android: id = "@ + id / Button03"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content"

android: onclick = "startAnimation"

android: text = "Fade" />

<button android: id = "@ + id / Button02"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content"

android: onclick = "startAnimation"

android: text = "Animate" />

</linearlayout>

<imageview android: id = "@ + id / imageView1"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content"

android: layout_centerhorizontal = "true"

android: layout_centervertical = "true"

android: src = "@ drawable / icon" />

<textview android: id = "@ + id / textView1"

android: layout_width = "wrap_content"

android: layout_height = "wrap_content"

android: layout_above = "@ + id / imageView1"

android: layout_alignright = "@ + id / imageView1"

android: layout_marginbottom = "30dp"

android: text = "Large Text"

android: textappearance = "? android: attr / textAppearanceLarge" />

</relativelayout>

5- Create a menu resource.

<? xml version = "1.0" encoding = "utf-8"?>

<menu xmlns: android = "http://schemas.android.com/apk/res/android">

<item android: id = "@ + id / item1"

android: showasaction = "ifRoom"

android: title = "Game">

</item>

</menu>

6- Change the Activity like the codes inserted below.

package com. vogella. android. animation. views;
import android. animation. AnimatorSet;
import android. animation. ObjectAnimator;
import android.app. Activity;
import android. content. Intent;
import android. graphics. Paint;
import android.sos. Bundle;
import android. view. Menu;
import android. view. MenuItem;
import android. view. View;
import android. widget. ImageView;
import android. widget. TextView;
public class AnimationExampleActivity extends Activity {
/ ** Called when the activity is first created. * /
@Override
public void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. main);
}
public void startAnimation (View view) {
float dest = 0;
ImageView aniView = (ImageView) findViewById (R.id. imageView1);
switch (view. getId ()) {
case R.id.Button01:
dest = 360;
if (aniView.getRotation () == 360) {
System.out.println (aniView.getAlpha ());
dest = 0;
}
ObjectAnimator animation1 = ObjectAnimator.ofFloat (aniView,
"rotation", dest);
animation1.setDuration (2000);
animation1.start ();
// Show how to load an animation from XML
// Animation animation1 = AnimationUtils.loadAnimation (this,
// R. anim. my animation);
// animation1.setAnimationListener (this);
// animatedView1.startAnimation (animation1);
break;
case R.id. Button02:
// shows how to define an animation via code
// also use an Interpolator (BounceInterpolator)
Paint = new Paint ();
TextView aniTextView = (TextView) findViewById (R.id. textView1);
float measureTextCenter = paint. measureText (aniTextView.getText ()
. toString ());
dest = 0 - measureTextCenter;
if (aniTextView.getX () <0) {
dest = 0;
}
ObjectAnimator animation2 = ObjectAnimator.ofFloat (aniTextView,
"x", dest);
animation2.setDuration (2000R.id. Button03:
// demonstrate fading and adding an AnimationListener
dest = 1;
if (aniView.getAlpha ()> 0))
dest = 0;
}
ObjectAnimator animation3 = ObjectAnimator.ofFloat (aniView,
"alpha", dest);
animation3.setDuration (2000);
animation3.start ();
break;
case R.id. Button04:
ObjectAnimator fadeOut = ObjectAnimator.ofFloat (aniView, "alpha",
0f);
fadeOut.setDuration (2000);
ObjectAnimator mover = ObjectAnimator.ofFloat (aniView,
"translationX", -500f, 0f);
mover. setDuration (2000);
ObjectAnimator fadeIn = ObjectAnimator.ofFloat (aniView, "alpha",
0f, 1f);
fadeIn.setDuration (2000);
AnimatorSet = new AnimatorSet ();
animatorSet.play (mover). with (fadeIn). after (fadeOut);
animatorSet.start ();
break;
default:
break;
}
}
@Override
public boolean onCreateOptionsMenu (Menu menu) {
getMenuInflater (). inflate (R. menu. mymenu, menu);
return super. onCreateOptionsMenu (menu);
}
@Override
public boolean onOptionsItemSelected (MenuItem item) {
Intent = new Intent (this, HitActivity.class);
startActivity (intent);
return true;
}
}

7- Create a new activity called HitActivity.

package com. vogella. android. animation. views;
import java. util. Random;
import android. animation. Animator;
import android. animation. AnimatorListenerAdapter;
import android. animation. AnimatorSet;
import android. animation. ObjectAnimator;
import android.app. Activity;
import android.os. Bundle;
import android. view. View;
import android. widget. Button;
public class HitActivity extends Activity {
private ObjectAnimator animation1;
private ObjectAnimator animation2;
private Button;
private Random randon;
private int width;
private int height;
private AnimatorSet set;
@Override
protected void onCreate (Bundle savedInstanceState) {
super. onCreate (savedInstanceState);
setContentView (R. layout. target);
width = getWindowManager (). getDefaultDisplay (). getWidth ();
height = getWindowManager (). getDefaultDisplay (). getHeight ();
randon = new Random ();
set = createAnimation ();
set. start ();
set. addListener (new AnimatorListenerAdapter () {
@Override
public void onAnimationEnd (Animator animation) {
int nextX = randon. nextInt (width);
int nextY = randon.nextInt (height);
animation1 = ObjectAnimator.ofFloat (button, "x", button. getX (),
nextX);
animation1.setDuration (1400);
animation2 = ObjectAnimator.ofFloat (button, "y", button. getY (),
nextY);
animation2.setDuration (1400);
set. playTogether (animation1, animation2);
set. start ();
}
});
}
public void onClick (View view) {
String = button. getText (). ToString ();
int hitTarget = Integer.valueOf (string) + 1;
button. setText (String.valueOf (hitTarget));
}
private AnimatorSet createAnimation () {
int nextX = randon.nextInt (width);
int nextY = randon. nextInt (height);
button = (Button) findViewById (R.id. button1);
animation1 = ObjectAnimator.ofFloat (button, "x", nextX);
animation1.setDuration (1400);
animation2 = ObjectAnimator.ofFloat (button, "y", nextY);
animation2.setDuration (1400);
AnimatorSet set = new AnimatorSet ();
set. playTogether (animation1, animation2);
return set;
}
}

Animation should begin after you have carefully completed the steps listed above. To do this, you can access the navigation activity through the ActionBar.

Animation capability in Android and how to create them
DotNek بازدید : 123 سه شنبه 18 خرداد 1400 نظرات (0)

The Internet has provided many possibilities for different users all around the world and nowadays, users do almost all their tasks through the Internet, in addition to providing convenience for users, the Internet can be so dangerous, so if you do not pay attention to providing proper security while using it, all the information which you have entered in it, may be made available to profiteers in a short while, due to the fact that there are lots of profiteers who are waiting to find a security hole in order to achieve their malicious goal, these profiteers are called hackers, and the point that should be mentioned is that due to hacker good income, the number of them is increasing day by day, so it is necessary to know the relevant tips to provide a better Internet security in order to stand up against the hacking attacks.

What are the types of Internet security threat?

What is Internet security?

It is a set of actions and techniques that are done in order to increase the security of your important information while using the Internet to do all tasks, such as online transactions, activities, etc., everything that is done is aimed at protecting your system against various threats that can endanger users’ information, this security specifically focuses on online access vulnerabilities and Internet usage.

Why is it important?

Nowadays, due to the fact that the number of people who use the Internet to do all their important tasks is increasing day by day, and they also spend most of their time on it, the importance of Internet security has increased significantly, so, first, it is necessary for all users to raise their awareness in this field and try to know all security tips due to the constant use of the Internet and also the need of entering important and personal information in order to do daily tasks, transferring important documents, online payments, etc., and this information may be provided to profiteers if you do not observe the necessary tips and do not know them properly, and as you know if they have access to it, they may take various actions, for example, one of the things that hackers may do with the information which was obtained, is requiring money in order not to publish it, so the users have to pay money to prevent the data from being published which may cost them a lot, or lots of other ways that they use in order to abuse your information, simply put, in addition to the many benefits that the Internet can have for all users, it can also be an insecure channel for exchanging information, which is why it is becoming increasingly important to pay more attention to its security tips and related issues.

What are the types of Internet security threat?

This security is an important issue which is threatened by various factors, that we are going to mention in the following section.

- Hackers:

The security can be attacked by various threats , one of the most important of which is hackers, they are people who make every effort to circumvent online security measures, and eventually, after doing their malicious acts and obtaining users’ personal information, they may abuse that information in various ways, hackers have different types, among which we can mention white hat, red hat, green hat, blue hat, etc., each of which uses his/her talent in various ways due to the fact that they have different goals.

For instance, they may do their best to show the existing security holes in order to help an organization in the security field or manipulate security instead, through each of these ways they can stand out among other hackers, as a result, they are one of the most important threats to security.

- Phishing:

Phishing is often being done in a form of an email and uses social engineering techniques to do so, valuable personal information can be obtained through phishing, from which attackers can eventually make a lot of money, this stolen information which is obtained through phishing may include data related to account numbers, documents, etc., all of which are of considerable value, knowing more about this threat is of a great importance these days, due to the fact that it affects various users who deal with the Internet, so users are becoming more and more concerned and try to know the tips that help them protect their important information while working with the Internet against such threats.

These emails are designed in such a way that cause users to think that they have been sent by an organization or a reputable person, so they may consider these emails as ones which have important subjects that need to be opened quickly, therefore, users prefer to implement all the commands they contain as soon as possible, as a result, they will easily provide all their important information to the people who sent such emails.

- Worms:

Worms can disrupt the security of the Internet by using a lot of bandwidth, and the important thing about them is that they do not need to connect to another program in order to spread themselves, unlike viruses.

 - Viruses:

Viruses are another important threat that affect the security of systems , they are transmitted like biological viruses between different programs and infect all of them, there are many reports every day that indicate the number of people whose important information have been lost or stolen due to viruses, there are many ways to protect the Internet against viruses, and among which we can mention the use of good and powerful antivirus software programs , and as you know, there are different types of them in the market, which may be paid or be free.

What are the types of Internet security threat?

- Malware:

Malware can cause a lot of problems in your systems, most of which occurs by downloading the programs you need from unreliable sources which makes your entire system available to profiteers in less than a few seconds.

- Botnet:

As soon as various systems are attacked by malware, they may be used in order to send malicious messages or denial of service (DoS) attacks, this threat can also be very dangerous for users, so you need to increase the security of your system against these attacks .

How to protect Internet security against cyber threats?

There are many ways to use them and observing all of them can increase the security against various threats , among which the following can be mentioned.

- Install a powerful antivirus:

There are many antivirus programs that can scan your entire system quickly to find and report viruses, some available ones are: Avira Free Antivirus, Avast, Panda, Kaspersky Basic Security, Bitdefender, AVG AntiVirus Free, etc., before choosing any of them, you need to know the features of each, then you can choose one of them according to the purpose of your antivirus installation.

- Do not enter unreliable sites:

There are many sites that as soon as you enter them, all system security may be affected due to malicious code they contain, so it is necessary to pay attention to sites that are certified in order to maintain the security of all your important information while using the Internet, as a result, do not enter sites which do not have SSL certificate.

- Block ads:

When you use the Internet in order to do your tasks, you will encounter a lot of ads on a regular basis, some of which may have been placed with the aim of infecting your system, which is the reason why you shouldn’t click on them, therefore you have to use the available software to block them, so that profiteers cannot endanger the system and steal the important information.

- Do not open phishing emails:

One of the threats that affect the security of information while using the Internet is phishing emails, which is being done by using interesting topics and also having URLs that are very similar to reputable companies and organizations URLs which causes users to click on them, therefore, they lose all their data, which is why the user must be aware of the ways to deal with them and delete such emails as soon as possible.

What are the types of Internet security threat?

Last word:

Internet security is an important issue and there are different types of threats that affect this security, in this article, we mentioned some of the most important threats, so that you can be aware of them in order to increase security and prevent profiteers from accessing personal information and documents in your system when using the Internet.

DotNek بازدید : 135 سه شنبه 18 خرداد 1400 نظرات (0)

As you know, these days users spend many hours throughout the day on the Internet and do most of their daily tasks through it, as a result, they enter very important information in their computers, which is the reason why it is necessary to protect your system against security threats which endanger the personal data, users may think that their computer is secure enough, so they do not need to worry about various threats, but this is not a true idea because all users should be concerned about their systems' security.

If you do not pay enough attention to this issue after a while you may encounter a huge problem which is a decrease in your system performance or its speed, so you cannot do all your tasks easily, therefore, the best way is to pay attention to your system security , there are many threats that may endanger your computer, among which we can mention malware, and we will discuss in more detail below.

Why is malware protection important?

What is Malware?

In fact, malware is a piece of code that can infect different computers which is written by programmers and enters the system of various users in different ways, and the users won’t find out their entry, simply put, any code that is placed on the systems of different users and disrupts the system function is a type of malware that is created by hackers, and they use them to achieve their goals.

The damage they do to your system includes, having access to your email account and try to send emails to various users that also contain malicious code in order to infect their systems, in addition to sending spam emails through this method, hackers can also perform other actions such as stealing users' personal information such as bank account number, password, etc., the important thing to know about them is that malware is always looking for existing vulnerabilities in your system and enter it through them.

Why is malware protection important?

Malware is a huge problem, and it is very important to protect the systems against it, to date, there have been many reports of various systems being infected by this type of attack, and many organizations have been affected by this attack, as you know, it can be done in different ways, but the common point in all of these methods is that they end up damaging the system in a way that causes a lot of problems for the user, so all users should pay attention to malware from the begging and be aware of the importance of protecting the system against their entry.

What are the ways for malware to enter users' systems?

These programs may enter the system in a variety of ways, including logging in via a USB drive, so as soon as any information enters your system, you should get help from an anti-malware in order to eliminate all suspicious items, so that they do not damage your system.

Another way is entering your system through malicious sites, which means that the user encounters malicious code after entering such sites that seem to be valid which may be placed in various ads and eventually, if you do not pay attention to the possible threats and click on any ad, you will easily give all your information to hackers.

Malicious emails which were mentioned earlier can cause a lot of damage to your system, so it is necessary to increase your information about this type of email and do not trust them in any way, and when you encounter them you should try to delete them as soon as possible, there are several signs that can help you determine if an email is malicious, including the following.

- Including an attractive topic for users

- These emails have URLs similar to a reputable company and there are only small changes in their letters

- Expressing topics that can provoke the user's emotions and cause the user to click on the email without thinking which can be different, for example, they may email you with the content that you have won a lot of money etc., so that, you will be so happy and enthusiastic to see this email, and you cannot think properly, as a result, you will do all the commands which are mentioned in the email and provide your important information to hackers , so they can remotely access your system.

Take the following steps to minimize the risk of malware:

As you know, malware is very destructive and can cause irreparable damage to your system as well as your information, as a result, you should do all the necessary things in order to increase system security against them , so that they cannot harm your system, which is one of the most important points that we are going to mention some tips in order to help you protect your system against them .

Why is malware protection important?

- One of the most basic ways to increase the security of systems against malware is to get help from a good anti-malware software, as you know, there are many of them in the market that may be paid or free, and it is necessary for every user to raise their awareness about their features, then you should try to choose one of the most suitable software available, according to your goal.

- Keep all the programs in your system up to date, due to the fact that each of the programs that you download may include bugs that the developers try to fix them in the updated version.

- There are various software programs that can help you in this direction, for example, they may have the ability to prevent your system from connecting to malicious websites or lots of other features, which is the reason why it is necessary to get help from them, and you should never forget to update them regularly.

- Never use the same password for all your accounts, because in this case when hackers can enter your system through various ways such as malware, they can also have access to one of your accounts’ password, so if you use the same one for all of your accounts, they can have access to all of them as soon as possible, as a result, they can damage your system easily.

- Observe the essential points while choosing the password properly, among which we can point to the importance of having at least 8 characters which is necessary to include uppercase letters, lowercase letters, numbers, elements, etc., and the more you choose your password according to the principles, the harder it will be for hackers to access your accounts.

- When you visit a site, you will encounter a lot of ads that malicious code may have been placed in them by hackers, so as soon as you click on them, you will lose the security of your system , as a result, it is necessary to use the available programs and block these types of ads in order to minimize the possibility of infecting your system and prevent profiteers from accessing the information in your system and abusing them in order to achieve their desires.

- Use firewalls that create a buffer zone between your IT network and other networks, simply put, a firewall prevents data from being transferred to your system without planning, hackers try their best to decrease the security of your network by using malware and spread various viruses between different computers, but firewalls can prevent this from happening and provide a lot of security for your system as well as your information .

Why is malware protection important?

Last word:

Security is an important issue and all the topics which it contains are of a great importance as well, one of the topics that is very important in security is the protection of computers and devices against malware , which in this article we have explained the reason of its importance as well as the necessary tips that must be taken into consideration in order to increase the security of your information against this threat, so that you can follow all the tips to achieve high security and make it harder for hackers to gain access to your personal information and abuse them in order to get what they want.

DotNek بازدید : 103 سه شنبه 18 خرداد 1400 نظرات (0)

Mobile phones have become an integral part of everyone's life today, and users meet most of their needs through mobile phones in a short time, given this, it can be concluded that important information, such as credit card number, photos of documents, personal and important information, etc., are also exist in it, now imagine that this information is somehow out of your reach and only hackers can have access to it, what do you think might happen? Will be your life and all your money in danger?

The answer is yes, and these possibilities can take place, so you need to increase the security of the information on your mobile phone and become more familiar with the issues that may endanger the security of this bag? You definitely do your best to provide the necessary facilities to increase its security and protect your information from being stolen by thieves, in this case, mobile is the same as the bag and today almost all users keep their information in this device, therefore the security of it is of a great importance.

Hackers may use various methods to gain access to information on people's mobile phones and use this information to harm different people, on the other hand, there are many ways that can be used to increase and prevent mobile security , in order to prevent hackers from achieving their goals, users have many questions about the ways that hackers can hack a mobile phone, also another important question that users have, which we intend to address in this article more, is whether someone can hack a mobile phone through a message or not.

Can someone hack your phone by texting you?

The answer to this question depends on your behavior after receiving the message, and no one can hack your phone just by sending you text if you do nothing, given that, hackers are increasing their knowledge day by day and using new methods of hacking every day, technology is now able to do things that we thought were impossible.

When hackers send a message in order to hack your mobile phone, if you do something wrong, they will eventually reach their goal, but if you, as a user, increase your information in this field in order to protect your information , you can respond to such attacks and keep your information secure, you need to know that the messages that hackers send to you have links to other websites which can endanger your information security, and if you click on them and refer to the mentioned links, your mobile phone will eventually be infected and hackers can gain access to your information easily.

These messages are usually very attractive and encourage the user to click on it, or they are messages make users worried about a specific topic, and they may eventually click on the links due to the feeling of stress and anxiety without thinking, and after a while, users realize that they have lost all of their important information, many messages may be sent to you daily, some of which are designed only to steal your information, in which case you should concentrate and do not open them, and if you open the message, do not click on the links in the title and do not refer to the addresses which are suggested in the message, as we mentioned, in the message, it is possible to mention the address of a phishing site, and eventually your device will be hacked by hackers through the message.

All hackers try to achieve their goal by arousing the users' senses and may use the feeling of fear, anxiety, sadness, happiness, etc., to put pressure on the user in order to do whatever they want as soon as possible and help hackers achieve their goal easily, as a result, a set of tasks must be performed so that the hackers can reach their goal, in addition, hackers may use other factors to hack information on people's mobile phones, some of which we will mention below.

Other ways to hack mobile:

- Use a spy mobile app:

There are various spyware programs that end up making the user's information inaccessible to them, these programs are very common among hackers, for example, they may use the InoSpy spyware program, iSpyoo which is an android spy software, SMS Tracker, HelloSpy, etc., pointed out that all of these can eventually lead the hacker to a lot of information, the thing about these types of apps is that most of them only work if someone has physical access to your device, in fact, these programs are mostly used by parents so that parents can control their children through these programs and check all messages, calls, etc.

- Malware:

Hackers use malware to perform all kinds of hacking attacks and can easily reach their target through them, which happens more often when users download their programs and software from unreliable sources, and causes a lot of damage to mobile security.

- Hack password to enter the phone:

One of the ways that hackers can use to access information on the mobile device of different users is password hacking, and if this password does not have the necessary safety, hackers can open it and access the information as soon as possible.

- By gaining access to different parts of the mobile phone:

After installing each application, a message will be sent to you which includes the massage that this app Would Like to access your data, etc., you should pay more attention to these kinds of massages, and try to limit the access of different applications to your data as much as possible, so that they cannot access your information and use it to achieve their desires easily.

- ...

In general, as we mentioned, hackers are changing their methods of hacking day by day, we have mentioned a number of methods that they use in order to hack systems, now we are going to mention some steps that you should take as in order to protect your mobile phone data against hacking attacks.

What should we do to increase the security of information on our mobile phones?

- Back up your data:

This is an important step that should be taken in order to increase the security of information on all devices, and if your data is stolen, it can help you protect your information, so you should pay attention to the fact that the backup data must be carefully monitored.

- Use reputable sources to download the software you need:

We have already mentioned that hackers may use malware to hack your mobile phone information, in which case you should make every effort to use reputable sources to download the programs you need and do not use the download links of programs that exist on various sites, as these programs may have been created for the purpose of hacking your device.

- Do not forget to update the software on your device:

Software produced by different companies may have bugs that will be fixed in the next update, which is why you need to update all existing programs regularly to eliminate any possible security holes.

hack phone by texting

Last word:

In general, hackers cannot achieve their goal only through SMS, and users need to cooperate with them, so users should prevent this by raising their level of knowledge and awareness, and do not open any message, and if you do, try not to click on any link or URL, because they may link you to a dangerous website like a phishing website and endanger your important information, so you have to pay attention to avoid clicking on any link even if it has an attractive topic like winning a prize through clicking on a link.

تعداد صفحات : 39

اطلاعات کاربری
  • فراموشی رمز عبور؟
  • آرشیو
    آمار سایت
  • کل مطالب : 383
  • کل نظرات : 0
  • افراد آنلاین : 1
  • تعداد اعضا : 0
  • آی پی امروز : 45
  • آی پی دیروز : 108
  • بازدید امروز : 49
  • باردید دیروز : 118
  • گوگل امروز : 0
  • گوگل دیروز : 0
  • بازدید هفته : 288
  • بازدید ماه : 2,168
  • بازدید سال : 14,230
  • بازدید کلی : 204,484