The majority of the participants in the present study had mobile phone and access to the Internet. More than half of the participants spent two hours a day on average using their mobile phone and the Internet, and mobile phones were mostly used to contact friends and search for information. The majority of the participants intended to use mobile phones and the Internet for planning their diet, checking blood glucose and other clinical parameters, and contacting their doctors. Half of the participants stated that using smartphone apps can be interesting and help them manage their diabetes, and intended to use apps "very often" for diabetes control in future. About a third of the participants stated that they had confidence in using apps for diabetes control. The participants considered choosing the right diet, adequate physical exercise, and blood glucose diary as their main problems.
The results showed that a significant number of the participants had mobile phones and smartphones. Similarly, Boyle et al.  in New Zealand (2017), Humble et al.  in the UK (2015), and Dobson et al.  in Canada (2015) reported a significant number of patients with diabetes had access to mobile phones and smartphones. Also, a significant number of the participants in the present study had access to the Internet, and more than half of them used the Internet for two hours a day on average. Similarly, in a study by Dobson et al.  on 44 patients with T2DM, more than 90% of the participants had access to the Internet. The results of this study in a developing country compared to other studies in developed countries showed that there was no significant difference in terms of mobile phone and internet access. The results of the present and similar studies confirm that the increasing use of communication technologies (such as smartphones and the Internet) has created the opportunity to provide patients with chronic diseases with health information, especially self-management information.
We found that rural patients with T2DM had less use of Internet and mobile than urban residents. The lower Internet use associated with rural residence was explained by differences in education and included personal limitations, such as a lack of skills, experience and familiarity in using online technologies.
The majority of the participants stated their intention to use mobile phones and the Internet, especially for planning their diet, checking blood glucose, and contacting their doctors, which agrees with the findings of a study conducted in Canada. More than half of the participants had a positive attitude toward, and the majority were confident in using apps for diabetes management, and half of the participant stated their intention to use apps in future for diabetes control. These results concur with those obtained by Conway et al.  in the UK (2015). Boyle et al.  cited that patients with diabetes expressed the following reasons for not using diabetes-related apps: not knowing such apps existed or their potential benefits, doctors did not recommend them to patients, patients did not feel confident without apps, and felt tired after using apps. According to Dobson et al. , the reasons for not using apps included the patients' unawareness of the availability of such apps and lack of confidence in them. However, in a study by Jenkins et al. , 75% of patients with stroke had the intention to use mHealth interventions and 83.3% had confidence that this technology could be an effective tool for their communication with healthcare providers. Hofstede et al. (2014)  reported the main reason for a positive attitude of patients with asthma and chronic obstructive pulmonary disease toward using apps as being time-saving and user-friendly, and supporting planned care when required.
In the present study, the most common problems that patients with T2DM faced in self-management were choosing the right diet, inadequate exercise, and blood glucose diary. Similarly, Dobson et al.  reported choosing the right diet, inadequate exercise and following up blood glucose level as the most common problems of patients with T2DM. Given the importance of self-management in patients with T2DM and availability of diabetes-related apps with features for monitoring blood glucose, physical activity, and dietary management, several studies have investigated the effectiveness of such tools on diabetes-related outcomes[38-40]. These studies have shown that apps can improve adherence with activities relating to diabetes management such as regular intake of medication and insulin shots, blood glucose self-monitoring, diet, and physical activity.
In agreement with Dobson et al. study , the relationships of age and duration of T2DM with patients' attitude and intention about using apps, and the use of mobile phones and the Internet were significant. Younger patients were more interested in using apps and had greater intention to and confidence in using them in future. Also, patients with diabetes for longer had poorer attitude toward and confidence in using apps. In the present study, patients with higher education levels had a better attitude toward and confidence in using apps, and used mobile phones and the Internet more often. These results agree with those obtained in studies by Song et al.  in the USA (2013) on pregnant women, and Jafari et al.  in Iran (2015) in patients with T2DM. A review study showed that most pregnant women with higher education considered using the Internet useful and reliable. These results may be due to the fact that patients with higher education levels have greater reasoning and critical thinking skills compared to others, and therefore have better judgment and higher confidence in mHealth technologies.
To our knowledge, the present study is the first study in a developing country to investigate the attitude and intention of patients with T2DM about using the Internet and smartphone apps for diabetes self-management. The present study was conducted on a sample of 176 patients in a city, which may be considered as a limitation. Given that the majority of patients with T2DM were in older age group, with low education level, participants' old age and poor education level can be considered another limitation.
According to the present study results, patients with a positive attitude toward and intention to use the Internet and smartphone apps for self-management were the younger ones, with higher education levels and a shorter period with diabetes. In the present study, the self-management problems of patients with T2DM were identified. It is recommended that diabetes self-management features of smartphone apps be designed according to the patients' conditions and needs. As suggested in Dobson et al. study, future studies should identify barriers to and facilitators of using the Internet and mobile apps for diabetes self-management.