Helloworld on android studio

Supporting 4.1 and up
Post Reply
brunoramos96
Phidgetsian
Posts: 10
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Helloworld on android studio

Post by brunoramos96 »

Hi everyone,
I'm a beginner in te area of programing in android, and it's my objective to use phidgets sensors in a Android's phone.
So I started by put my phidgets sensor collecting data for my android. I read the information in the phidget's site, and after downloading de examples that includes the HelloWord example I tried to import tht project like phidgets teaches. However, an error message appeared saying that the project that I chose contain non-ASCii characters.
I searched for a solution, and almost everyone said that the mklink /D "C:\android-sdk" "C:\Users\x user\AppData\Local\Android\Sdk" would solve my problem. But it isn't solved. I would like to Knbow if any of you know how to solve, or how to put an Hello World Example running on my Android.
Thank you
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Post by jdecoux »

I cannot replicate your non-ascii characters problem, so I will take this time to ensure you are importing the project from the correct folder.

After unzipping the example download, you may end up with a folder called "Phidget22_HelloWorld_Java_Android_Ex_########". This is not the project folder, you will want to import the folder inside that one, called "HelloWorld".

If you do that, importing the project should be straightforward. You may encounter a build error indicating you need to install different build tools, but the link in the error message installs them for you.
brunoramos96
Phidgetsian
Posts: 10
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Re: Helloworld on android studio

Post by brunoramos96 »

jdecoux wrote:I cannot replicate your non-ascii characters problem, so I will take this time to ensure you are importing the project from the correct folder.

After unzipping the example download, you may end up with a folder called "Phidget22_HelloWorld_Java_Android_Ex_########". This is not the project folder, you will want to import the folder inside that one, called "HelloWorld".

If you do that, importing the project should be straightforward. You may encounter a build error indicating you need to install different build tools, but the link in the error message installs them for you.
Hi,

Thanks for the tip. I solved already my problem. Basicly the problem was in characters like "-" or "~", that were included in the nameof the folder. For now my problem is in programming in android studio.
I want to build a app that allows the user to measure the acceleration of a machine, using a sensor Phidget_1044. But I am a beginer in android and also java. I wanto to start just by running the example that phidgets give for that sensor por java-android, but it's not working.
Do you have any tip for me to start?

Best regards
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Post by jdecoux »

What kind of problem are you having with the example, and which example are you using?

How is the Phidget connected to the Android device? Is it plugged in direct via USB, or over the network?

If you are trying to connect over the network, do you have a version of the Phidget Network Server running on the machine the Phidget is plugged into? And is your Android device connected to the same local network?
brunoramos96
Phidgetsian
Posts: 10
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Re: Helloworld on android studio

Post by brunoramos96 »

jdecoux wrote:What kind of problem are you having with the example, and which example are you using?

How is the Phidget connected to the Android device? Is it plugged in direct via USB, or over the network?

If you are trying to connect over the network, do you have a version of the Phidget Network Server running on the machine the Phidget is plugged into? And is your Android device connected to the same local network?
Tha example is this: https://www.phidgets.com/downloads/phid ... oid_Ex.zip

The error that appears on my android studio after trying to import the project related with the example above is this:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

I'm trying to fix this but nothing is working...
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Post by jdecoux »

A quick search seems to indicate you need to create a file called local.properties in your project folder (called "Spatial" in the case of the Spatial example, unless you renamed it).

In that file you need to add the line

Code: Select all

sdk.dir=C\:\\Users\\UserName\\AppData\\Local\\Android\\Sdk
replacing UserName with your user name on that computer.
brunoramos96
Phidgetsian
Posts: 10
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Re: Helloworld on android studio

Post by brunoramos96 »

That's the problem. When I searched about this error I found that possible solution, but it doesn't work. I'll try to reinstall the android studio. Old school way :(
ngetrip
Fresh meat
Posts: 1
Joined: Mon Feb 25, 2019 10:29 pm
Contact:

Re: Helloworld on android studio

Post by ngetrip »

I think eclipse is better. Code make more clear
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Post by jdecoux »

If you are developing for Android, it is important to consider that Google ended official Eclipse support in 2016, and recommends Android Studio for future Android development.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests