• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Android tags seem not to install in apk

 
Ranch Hand
Posts: 89
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are trying to run an app on an android watch that sends data to a database. When we run the app from android studio on the watch it works well.
However, when we try to build the apk and manually install the app on the watch the data is not sending.

It seems it may be due to some tags not being saved to the apk but I'm not sure why this is happening.

Ex. of tags:

Thanks so much!
 
Master Rancher
Posts: 4250
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

the data is not sending.


Can you down load the logcat to see if there are any error messages?
 
Glenda Karen
Ranch Hand
Posts: 89
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply!
I tried to logcat in adb and seems ok.
I did some further testing and I noticed when I hardcode the data, it is sending when I install the apk. When the data is not hardcoded, it is only sending when I run from android studio.
 
Norm Radder
Master Rancher
Posts: 4250
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you add some print statements for debugging to the code in the apk so that the conditions when the apk are executed is printed to the logcat.  Then download the logcats and see what the difference is between when the code works in Android Studio and when it does not work.
 
Glenda Karen
Ranch Hand
Posts: 89
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, that's a great idea.

Is there a way I can get the logs without plugging in my device?

In order to collect the data from my watch I need it unplugged(since the charger is blocking the sensor) before I was just using logcat when it was plugged in.
 
Norm Radder
Master Rancher
Posts: 4250
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see that there is an adb connect command, but I have never used it.
Otherwise, unplug, run the tests, plug in and download the logcat.
 
Glenda Karen
Ranch Hand
Posts: 89
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much!

I unplugged my device, ran the app, replugged and went to logcat in android studio.

The Logs looked correct and normal, the only issue I had with logcat was once I plugged in the device it only started showing the logs from that point but since the device was no longer around my wrist the data stopped being collected so I couldn't see my println of the data.

But either way, while the device was on my wrist I could see data displayed on the watch but was not being sent to the database.
 
Norm Radder
Master Rancher
Posts: 4250
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

once I plugged in the device it only started showing the logs from that point  


That is different from what I expected.  I did not know that the logcat was not being collected when the device was not plugged in.  I don't know how watches work.  I am only familiar with tablets.

Another approach I have used is to write what is printed by System.out.println  to a file on the device and then it is not lost in the midst of the logcat details.  
Here is a link to some debug code: https://www.dreamincode.net/forums/topic/389160-android-app-debugging-aids/
 
Glenda Karen
Ranch Hand
Posts: 89
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much for your help!

We were able to get it working by adding permissions in manifest and changing some of the way we were sending the data.
 
Crusading Chameleon likes the size of this ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic