Smartphone Programming

Smartphones run using a variety of operating systems -- Android, iOS and Windows Mobile most commonly -- and an even wider variety of programming languages, including Objective-C, Java, Visual C#, C++ and .NET, not to mention HTML5 and JavaScript, and cross-platform frameworks such as PhoneGap.

Share tech news, updates, or what's on your mind.

Sign up to Post

With help from Zakaria Acharki and leakim971, I have added touch events to my drawing routine at: (modified so it doesn't send data to me).

However, sometimes when drawing on a touch screen, the line drawn is not under the finger. For example:drawing problem image.
I have tested the routine on a: Pixel Phone, Iphone, Samsung tablet, Microsoft Surface Book. The routine always draws at the wrong place using the Pixel Phone. The others frequently (not always) draws at the wrong place when zoomed in to and scrolled down on the page. Zooming and scrolling is disabled on the image itself but you can zoom and scroll off the image.

I believe this is the code causing the problem:
if( ev.targetTouches ) {
    var rect =;

    ev._x = ev.targetTouches[0].pageX - rect.left;
    ev._y = ev.targetTouches[0].pageY -;

Open in new window

I tried changing:
var rect =;

Open in new window

var rect = canvas.getBoundingClientRect();

Open in new window

where canvas is defined as:
canvas = document.getElementById('imageView');

Open in new window

But that did not work.

I will appreciate and try any suggestion even if your not sure if it will work.


Here is all the JavaScript code for the routine:
var imageData, context, pixels;

function clearCanvas()
	context.putImageData(imageData, 0, 0);

function checkFields()
	var themessage = "Please complete the following 

Open in new window

Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.


I need to setup a MacinCloud Environment for Xamarin Mobile Application Development.

What should be the configuration of MacinCloud Machine that I should order.

Thanks & Regards,


I have a Samsung Note 9 phone.

My contacts are located in two different places; sim card and Gmail account.

There are different contacts in both of these places but would like all imported to Note 9 phone.

Also, there are some contacts which are the same in both places.

Is there a way of syncing together contacts in Gmail with contacts on this phone, where contacts were imported from sim card, without having duplication of contacts?

I have a UIPageViewController which I am using for onboarding/walthrough screens but at the moment they only work with swipes. I added a button but I can't actually connect it and create an IBAction. I was able to programatically create a button that could print to console but I don't know how to get it to move the screens like swiping does.

class PageViewController: UIPageViewController, UIPageViewControllerDelegate, UIPageViewControllerDataSource {
    var pageControl = UIPageControl()
    // MARK: UIPageViewControllerDataSource
    lazy var orderedViewControllers: [UIViewController] = {
        return [self.newVc(viewController: "sbBlue"),
                self.newVc(viewController: "sbRed")]
    override func viewDidLoad() {
        self.dataSource = self
        self.delegate = self
        // This sets up the first view that will show up on our page control
        if let firstViewController = orderedViewControllers.first {
                               direction: .forward,
                               animated: true,
                               completion: nil)
        // Do any additional setup after loading the view.
    func configurePageControl() {
        // The total number of pages that are available is based on how many 

Open in new window


I am working on an iOS application (in nativescript) that needs to get and post some data to an API in the background each 5 minutes. Now it seems that iOS is closing my application so I took a look at the long running tasks section of but I fail to see how I should configure an interval now.

Also while it works correctly on the simulator (not thinking about the interval) with the debug fetch command, I can't get it to work correctly on a real device.
I have a cordova app and would like to make some changes to the build.gradle file. Basically, I would like to remove some lines (with **) and add some new statements (*)

I have added the lines but when I build my code with  cordova  the gradle file gets regenerated and my changes are lost.

I know that I can use the android studio but I am automating my process and would do it with my current automation script

Can you please let me know how to make this change with maybe gradle.extra file

I am using Cordova 6.5.0

Thanks for the help

here is the snippet from the build.gradle file

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    debugCompile(project(path: "CordovaLib", configuration: "debug"))
    releaseCompile(project(path: "CordovaLib", configuration: "release"))
    **//compile ""**
    compile ""
    compile "com.squareup.okhttp:okhttp-urlconnection:2+"
    **//compile ""**
    *compile ''
*apply plugin: ''

Open in new window

Published iOS app about 18 months ago using Xamarin Studio.  Now that its Visual Studio 2017, need to recreate Apple certificates and profiles and then use fastlane to install them on my Mac.  App builds fine and it runs on an iPhone attached to my Mac.  Looking for a consultant who can help me with this process.
Hi all
We have a number of Android tablets, some of which are misbehaving. I need to be able to save (or send) the system logs (and maybe dmesg as well, if poss) continuously to the removeable SD card, or alternately, to send the logs out to an FTP server. Can someone help me do this please? I will not be able to "root" the devices.
Thanks in advance
My company is paying for me to go to training for mobile app development for Android and iOs.  I am in the IT dept 15 years manager and I have basic programming experience.  Can someone recommend a hands on course I can take.
I need to factory reset MC3090 with Win CE5 and MC3190 with Win CE6.
Would anyone have the image files?
C++ 11 Fundamentals
LVL 12
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Looking for a better security solution for home directory listing buzz in.  
Due to the increase mail package thefts, HOA proposed to completely remove remote buzz in option.  Currently visitors dialing the code downstairs, call comes to resident's cell phone,  and by pushing '9' the door unlocks;  If we remove that option the resident has to go downstairs to open the door to the visitor. Definitely inconvenient option.  But could be safe. Recently we even noticed the food delivery guys stealing packages on the way out.

My idea to improve it is to add a small cam downstairs.  When someone dialing in the call comes to resident's smartphone.  Resident immediately see shows coming in and make a decision to buzz person in or not.   Can this be implemented for a building of 50 units?  

Any ideas appreciated.   Thanks!!
I had this question after viewing Using AT commands with C.

I'm doing a project and want to connect my gsm "click" to my phone USING C PROGRAMMING, have it wired up ok just the program is letting me down..... [ I want the gsm to send a message to my phone ]
The GSM is connected to the UART serial port of my 8051f020 microcontroller, any help much appreciated my program is as follows:

 void send_it (void) interrupt 4 using 1   // This is the ISR 
		TI0 = 1; // TI must be cleared by software when writing directly  
	                       // to SBuf  as shown in the previous program – However,   
                   // the  Printf function requires TI to equal “1” on entering
		          // the function.
		printf ("Hello \n\n");  
   		printf ("This text was sent to the Uart using Printf \n\n"); 
    printf("AT+CMGF=1<CR>%c\n\n"); // configured the GSM module to SMS mode                                     

    ("AT+CMGS=\"08******\"HELLO"); // send mobile number to the GSM           

Open in new window

How to send message in whatsapp without open whatsapp apps using android?
Say, Whatsapp Broadcast Msg Info displays READ and Delivered. I want some way to get a list of the Delivered (but not read) in order to be able to resend.
Please suggest a software of method. Does Whatsapp Business make this easier to manage than Whatsapp? I've tried Whatsapp web but this doesn't allow me to export a list and difficult to use in a web interface.
Tx Shaun
How to identify editing on AMR file? Is there any softwares for that the phone call recorded was edited or not!
I'm using Android Studio and I would like to be able to pickup am image from the gallery, resize it and make it fit inside a rounded square (of about 300x300px) by maintening the correct aspect ratio. At the moment, I'm able to resize it and display it as a circle with this code:

FixBitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
                bitmap_to_save = scaleBitmapAndKeepRation(FixBitmap, 320, 320);

                RoundedBitmapDrawable roundDrawable = RoundedBitmapDrawableFactory.create(getResources(), bitmap_to_save);

Open in new window

However, I would like to know if it is possible to make the bitmap look like my attached image. Moreover, it would be important for me to resize the image without losing the original aspect ratio.

It is not exactly a well square rounded figure, so I'm not sure that it is possible to do it in Android.

I hope you can help me, thanks!

EDIT: I'm using Picasso library for the moment, and it seems to work. Anyway, I would like to keep always the same picture size (300x300 px) and the aspect ratio. How can I do it?
I used following code for phone call.But the call is not working .can anyone help me? I also given manfest Call Phone permission.

 call = (TextView) findViewById(;
        call.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                String no = call.getText().toString();
            //    Toast.makeText(Accepted_Details.this, no, Toast.LENGTH_SHORT).show();
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:" + no));

                /*if (ActivityCompat.checkSelfPermission(Accepted_Details.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
                    // TODO: Consider calling
                    //    ActivityCompat#requestPermissions
                    // here to request the missing permissions, and then overriding
                    //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                    //                                          int[] grantResults)
                    // to handle the case where the user grants the permission. See the documentation
                    // for ActivityCompat#requestPermissions for more details.
We want to offer our customers the possibility to download their APN settings trough a browser.
Apple has a Configuration Utility, that works fine.

It seems to be an XML like binary, that includes the details of the APN settings.
When accessing this file in the default (Safari) browser, it asks if you wish to load the config. If so, it loads the APN settings into the phone.

Does Android offer the same option?
I've been trying to fix this for days now. Using Xamarin and Visual Studio, I deleted the asset catalogs/media folder then I used app icon set creator to create the icons. I then went into info.plist under visual assets and hit add catalog, then dragged the icons into the slots.

No matter how many times I try this I get the same error.

Since this is xamarin, I was told I have to create an IPA file and upload using ApplicationUploader.  The file uploads but then I get an email from Apple with a build file error shown above.

Does anyone know how to fix this?


Missing Info.plist value - A value for the Info.plist key 'CFBundleIconName' is missing in the bundle

Open in new window

Fundamentals of JavaScript
LVL 12
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Need to know about how does it work?

I send a text message and I got a reply text message having some info., e.g., this is what's provided by Blue Cross Blue Sheild:
Text ID to BCBSIL (123456) to receive ID card information

how does this work and how I can configure it for my own use?

Please advise/guide/suggest ... thanks in advance.

How to use c4.5 classifier in android studio to process the  accelerometer and and gyroscope  sensor data from phone.
Hi there,
I need a sample application to build off to accomplish the following:
Scan a ticket that has a QR code.
As the ticket gets scanned add it to a datagrid or listbox (doesn't matter)
Once all the codes are in this data repository and on button click stores it on a database.
I don't expect to someone in here write something from scratch this escenario. But if you have seen something that can get me ahead on things I will greatly appreciate it.
If you have an idea of an aspx app or windows
Can someone guide me to making a simple application on android wherein the screen is blank and everytime someone touches the screen a small rectangle is drawn on and then erased the next time.
Hi Experts,

Iphone Cordova App. I'm getting a location request every time the app loads how do i get rid of it.

"var/containers/Bundle/Application/....www/index,html@ Would like to Use your Current Location.

When the app installs the correct location alert, followed by this one, then this one every time the app opens?


Hi there, just curious if anyone can help me with an IFTTT applet ?

What I need to do is...
If a specific user on Twitter tweets something, then send that tweet to a FB Group Chat

I can see alot of similar ones, like twitter post and send an FB msg, but not to group chat

Smartphone Programming

Smartphones run using a variety of operating systems -- Android, iOS and Windows Mobile most commonly -- and an even wider variety of programming languages, including Objective-C, Java, Visual C#, C++ and .NET, not to mention HTML5 and JavaScript, and cross-platform frameworks such as PhoneGap.