We have developed a motion and noise artifact (MNA)-resilient atrial fibrillation (AF) detection algorithm for smartphones that eliminates MNAs, and then detects AFs in smartphone camera recordings. MNA-corrupted episodes are observed to have larger values of turning point ratio (TPR), pulse slope, or Kurtosis compared to clean AF and normal sinus rhythm (NSR) episodes. On the other hand, AFs are shown to have larger root mean square of successive RR differences (RMSSD) and Shannon Entropy (ShE) . Our developed AF algorithm is capable of separating MNAs, NSRs, AFs, which enhances the specificity of AF detection. We have recruited 88 subjects having AF at baseline and NSR after electrical cardioversion, and 11 subjects having MNA-corrupted NSRs to evaluate the performance of our AF algorithm. The clinical tests show that the proposed AF algorithm gives higher accuracy, sensitivity and specificity of 0.9667, 0.9765, 0.9714 compared to the previous AF algorithm .