I want to throw in my two cents, even though this is an old question but commonly asked to do simple thing - autostart. I tried all the suggested solutions in all the answers for this question. NONE of them worked for me. I am using Raspberry PI Model 2 with Raspbian.
The only way I could get my application to autostart successfully is through a script as follows. I say successfully because my application started as expected without having any issue like starting with wrong work path.
1.Create an empty file with extension .sh and name it whatever you want.
2.Copy and Paste the following EXACTLY except change "your application name" to the script name that you just created.
### BEGIN INIT INFO
# Provides: noip
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
### END INIT INFO
#change /direct/path/to/your/application to the path your application is in.
cd /direct/path/to/your/application # example cd /home/pi/myprogram/
#change YourProgramExactName to Exact name of your program that you want to auto start
Then, save the script file within your application folder
/home/pi/.config/autostart folder. It might be different in your case. Just open your home folder and enable view hidden folders. open
within autostart folder you will need to create a shortcut to your script file that you created as follows. Create an empty file with extension
Copy and paste the following in the empty desktop file except you will need to change
Icon field's value.
Save and close the file after changing all the necessary fields. You are done. Just test it out.