jQuery Mobile Issues

$(”).click() fires twice with using alert().

I found out that in my case the addition of data-role="page" to my page container prevented tap events from being fired twice.

meta size for android is not working

Its seems that width=device-width and user-scalable=yes needs to be on its own line


    <meta name="viewport" content="width=device-width;
    user-scalable=yes;
    initial-scale=5.0;maximum-scale=5.0;minimum-scale=1.0"/>

sample code:

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Page Title</title> 
    
    <!--Don't format this meta because it has to be in lines for it to work, to zoom change the value in initial-scale-->
    <meta name="viewport" content="width=device-width;
    user-scalable=yes;
    initial-scale=5.0;maximum-scale=5.0;minimum-scale=1.0"/>
    <!--***********************END*************************************-->
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
</head> 
<body> 

<div data-role="page">
    <div data-role="header">
        <h1>Page Title</h1>
    </div><!-- /header -->

    <div data-role="content">   
        <p>Page content goes heasdfre.</p>      
    </div><!-- /content -->

    <div data-role="footer">
        <h4>Page Footer</h4>
    </div><!-- /footer -->
</div><!-- /page -->
<script>


$('h1').click(function(){
    alert('header tag');
});

</script>
</body>
</html>

Phonegap jQuery Mobile error – same origin policy

I’m developing an android application thru phonegap and I like to test my application in Chrome However jquery mobile was causing this error->

XMLHttpRequest cannot load file:///home/sock/Desktop/phonegap-2.7.0/lib/android/example/assets/www/js/jquery.js?_=1369249074564. Origin null is not allowed by Access-Control-Allow-Origin. jquery.js:8416
XMLHttpRequest cannot load file:///home/sock/Desktop/phonegap-2.7.0/lib/android/example/assets/www/js/jquery.mobile-1.2.0.js?_=1369249074596. Origin null is not allowed by Access-Control-Allow-Origin.

The way around this is to close all chrome browsers and run this is the command line (I’m using ubuntu)

$ chromium-browser --allow-file-access-from-files

or

$ chromium-browser --disable-web-security --user-data-dir

Chrome will open again and now you will not get this error when you run your page.


I was receiving the error when doing ajay request:


XMLHttpRequest cannot load file:///home/example/assets/www/delete.txt. Origin null is not allowed by Access-Control-Allow-Origin.

this error occurs in chrome but doesnt occur in the app when deployed so I disable this warning for developing purpose by running

$ chromium-browser --disable-web-security

tags:
cross origin

Setting up Android Emulator or physical device

Android Emulator

Its really slow to boot up but once its reaches the home screen its good enough, don’t close the emulator or you’re going to wait for the whole booting process again. In eclipse, to run you current app just click on “Run example as” (the green arrow) and choose the emulator. However if you want to be faster and you already have an android device. Just plug your android to the computer (USB). When you click on “Run example as” your device should show. To check if eclipse is reading you device go to the DDMS tab and see the device listed and yours should be there if plugged in.

Also there may also need to install specific packages in the Android SDK Manager for this to work. I’m not sure, I did a lot of installing following a lot of tutorials in the past day trying to get this to work.

phonegap installation example using Windows

How to create your first phonegap android application using Windows

links
http://developer.android.com/sdk/index.html#ExistingIDE
http://phonegap.com/download/#
http://developer.android.com/sdk/installing/installing-adt.html

Android Impression i10 tablet hack list

Impression i10 tablet

Hard reset/factory reset impressions i10

Download .apk app files

installing android market/google play

finding Device ID

root device (I selected psneuter on the exploit)

trying to update firmware:
I tried to update it to 4.01 and brink it (broke it). The tablet wouldn’t boot anymore, it would only stay on the impression screen. I believe the error was in the version of the sdfuse I downloaded. When trying to upgrade to new firmware (power and volume up button) the first two of loading boxes were filled with white and then green for the next following boxes but it wouldn’t fill the last long box then it would shut down (the screen goes black). Then I downloaded a different sdfuse (used an sd micro reader to open it on my conputer).
Resource:
http://forum.xda-developers.com/showthread.php?t=1151330&page=21
Now when I tried to upgrade, the same boxes appeared but they were all filled completely with only green and then auto shutdown (black screen). Then it started to work. In the meanwhile while doing all this I also did factory reset (camera + power button). I don’t know if factory reset had any thing to do with it working.

Titanium Appaccelerator error fix

Error when trying to open Titanium: Your project contains error(s), please fix it before running it

This can be caused by an out of date “Debug Certificate” fixed as follows:

IF ALL FAILS THEN THIS GOTTA BE THE SOLUTION:

Delete your debug certificate under ~/.android/debug.keystore (on Linux and Mac OS X); the directory is something like %USERPROFILE%/.androidon Windows.

The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.


Resource

Communication between Arduino and Computer using Python

Python code:

#communications between arduino and computer using python
import serial

#enter your device file
ser = serial.Serial('/dev/<your_device_file>', 9600) //windows: '/dev/com4' | linux: '/dev/ttyACM0'
while 1:
	print ser.readline().strip('\n')

Arduino Code:

/*
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include 

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}

Additional information

>Initial cost associated in selling a Mobile Application

>When trying to sell an app you’ll need to decide whether you want to developed for the iPhone, Android (2 most common) or both. You’ll need to publish your app at each distributor store.

Android you’ll navigate to their development site and sign up and pay a $25 fee. For the iOS is the same process you’ll go to their development site and pay $99/Year to $299/Year.

tags:
itunes connect, create account, developing, develop, itunes, application