[Working Code Oct 2019 ] Real Time Accelerometer Data Plot in Android using MPAndroidChart Library

29
133



[Updated Oct 2019] Download full working code from the GitHub repository.

Watch the full video to understand the code. I have tested the GitHub code on 17 Oct, 2019 and updated the code and it is now working again. Please do not forget to like and subscribe to this channel.

Keywords:
MPAndroidChart Library Example
Using these libraries, drawing charts on Android could never be simpler. MPAndroidChart library works on Android API 8 and above, but if you are using animations, it works on API 11 and above. Animations is one of the greatest features apart from easy data input, this library could have. Some how I feel animations give good user experience to an application. Through MPAndroidChart library, we can use more than 25 inbuilt animations, also can define custom animations. When making charts on Android MPAndroidChart library which falls under the Apache 2.0 license, we can draw a:

Simple Bar Chart
Grouped Bar Chart
Horizontal Bar Chart
Simple Line Chart
Line Chart with Cubic Lines
Grouped Line Chart
Combined Line and Bar Chart
Pie Chart
Scatter Chart
Candlestick Chart
Radar Chart

******************************************
Please subscribe this channel to get live updates directly into your inbox whenever I upload a new video.

————————————————————
Support us on KGPTalkie Facebook Page

************************************************
Please don’t forget to LIKE this video and SUBSCRIBE this channel. Thanks for watching.

********************************************

mpandroidchart,
mpandroidchart real time,
mpandroidchart horizontal bar chart,
mpandroidchart animation,
mpandroidchart line chart tutorial,
mpandroidchart real time graph,
mpandroidchart sqlite,
mpandroidchart tutorial,
mpandroidchart line chart,
mpandroidchart android studio,
mpandroidchart barchart,
mpandroidchart android,
mpandroidchart android example,
mpandroidchart bar graph,
mpandroidchart bar chart labels,
mpandroidchart bar chart example,
mpandroidchart bar chart scroll,
mpandroidchart bar chart tutorial,
mpandroidchart candlestick chart,
mpandroidchart candlestick,
mpandroidchart chart example,
mpandroidchart dynamic data,
mpandroidchart date,
mpandroidchart date x axis,
mpandroidchart demo,
mpandroidchart database,
mpandroidchart example,
mpandroidchart example pie chart,
mpandroidchart example code,
mpandroidchart firebase,
mpandroidchart grouped bar chart,
mpandroidchart horizontal bar chart example,
mpandroidchart highlight,
mpandroidchart in android,
mpandroidchart json,
mpandroidchart live data,
mpandroidchart linedata,
mpandroidchart live chart,
mpandroidchart labels,
mpandroidchart linechart multiple dataset,
mpandroidchart multiple line chart example,
mpandroidchart multiple line chart,
mpandroidchart marker,
mpandroidchart multiple lines,
mpandroidchart onvalueselected,
mpandroidchart pie chart,
mpandroidchart pie chart tutorial,
mpandroidchart pie chart example,
mpandroidchart pie chart animation,
mpandroidchart real time chart,
mpandroidchart radar chart,
mpandroidchart real time example,
mpandroidchart scrollable,
mpandroidchart stacked bar chart,
mpandroidchart stacked bar chart example,
mpandroidchart tutorial better than android graphview,
mpandroidchart tutorial better than android graphview 3- linechart using mpandroid 1/3,
mpandroidchart tutorial android,
mpandroidchart time series,
mpandroidchart tutorial pie chart,
mpandroidchart time x axis,
mpandroidchart xaxis labels,
mpandroidchart xaxis label date,
mpandroidchart youtube,
mpandroidchart zoom,
mpandroidchart 2 lines
graphview,
graphview android,
graphview android studio,
graphview real time,
graphview bar graph,
graphview tutorial,
graphview real time example,
graphviewseries,
graphview java,
graphview example,
graphview swift,
graphview example in android,
graphview android download,
graphview in android,
graphview in android studio,
graphview library android,
graphview android tutorial,
graphview viewport,
graphview vs mpandroidchart,
graphview zoom

Nguồn: https://fliptrazon.com

Xem thêm bài viết khác: https://fliptrazon.com/cong-nghe/

29 COMMENTS

  1. Updated Working Code on 17th Oct 2019. Watch other series on Android here: https://www.youtube.com/watch?v=pkT7DU1Yo9Q&list=PLc2rvfiptPSQrErIlwHz7DZrNfhFdDXa6

  2. I HAD THE FOLLOWING ERROR
    "More than one file was found with OS independent path 'META-INF/proguard/androidx-annotations.pro"
    WITH THE TUTO, IF ANY ONE FACE IT FIX IT WITH:
    putting the following in your gradle file as a temporary workaround while we fix the issue in alpha10:

    android {

    packagingOptions {

    exclude 'META-INF/proguard/androidx-annotations.pro'

    }

    }

    into the android build.gradle

    the things should work properly.

  3. Thank you for posting this informational and interesting tutorial. I was excited to clone the project and run it. When cloning from GitHub with Android Studio 3.4 0 get the following errors. Have you tried cloning it and running it in Android Studio 3.4 0 with stock settings?

    1. 14:15 Gradle sync failed: Operation timed out (Connection timed out) (1 m 15 s 287 ms)

    2. 14:15 Error Loading Project: Cannot load 2 modules

    Specifically, for error 2 above, two app.iml files are missing. Closing the project and re opening it does not generate these files as expected.

    I am new to Android Studio and don't want to spend a lot of time on this. Any advice would be appreciated but not expected. Thanks again for your incredible tutorial.

  4. excellent tutorial, congratulations I have followed the video without audio but I didn´t have troubles with the final result. Maybe to the people, just try …………. thread.start(); 🙂

  5. thank you so much.. it works for me could you make a video on how to transfer the data in a csv file. 🙂

  6. I am getting an error. NullPointerException at the set.getEntryCount() in addEntry(). Now if I handle it using try catch block. Then also the app runs, but no plot is shown. The error is

    2018-10-19 14:22:24.316 2884-4342/? E/Sensors: handleToDriver handle(0)
    2018-10-19 14:22:24.372 2884-4342/? E/Sensors: handleToDriver handle(0)
    2018-10-19 14:22:24.372 2884-4342/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
    2018-10-19 14:22:24.372 2884-4342/? E/Sensors: handleToDriver handle(3)
    2018-10-19 14:22:24.428 2884-4342/? E/Sensors: handleToDriver handle(3)
    2018-10-19 14:22:24.429 2884-4342/? E/Sensors: new setDelay handle(3),ns(5000000)m, error(0), index(4)
    2018-10-19 14:22:25.012 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:25.894 2884-3069/? E/WifiStateMachine: onRssiThresholdBreach event. Cur Rssi = -68
    2018-10-19 14:22:29.593 2884-4160/? E/Sensors: handleToDriver handle(0)
    2018-10-19 14:22:29.593 2884-4160/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
    2018-10-19 14:22:29.920 31370-31384/? E/BluetoothServiceJni: Callback env check fail: env: 0x0, callback: 0xe1f85620
    2018-10-19 14:22:29.920 31370-31384/? E/BluetoothServiceJni: Callback: 'callback_thread_event' is not called on the correct thread
    2018-10-19 14:22:30.113 2884-10232/? E/Sensors: handleToDriver handle(0)
    2018-10-19 14:22:30.114 2884-10232/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
    2018-10-19 14:22:30.129 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:31.921 2884-3069/? E/WifiStateMachine: onRssiThresholdBreach event. Cur Rssi = -82
    2018-10-19 14:22:35.251 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:40.365 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:45.496 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:50.608 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:55.747 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0
    2018-10-19 14:22:58.960 2884-3069/? E/WifiStateMachine: onRssiThresholdBreach event. Cur Rssi = -74
    2018-10-19 14:23:00.861 2189-2290/? E/MAL-RDS: ( rds_ru_3gpp_status_ind, 1893) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x8 sim:0

    Like this. What to do?

  7. He used code from this repo: https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/RealtimeLineChartActivity.java

  8. I created a gist. https://gist.github.com/rakeshg147/937ec7a8615024a6013cec47d642393f
    Hope this helps.

  9. Do you happen to have the code in a repository ? I implemented your solution but is not working

  10. https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/RealtimeLineChartActivity.java
    I got help from this link

    after
    data.notifyDataChanged();
    you also have to add
    mChart.notifyDataSetChanged();

  11. hello and thanks for Your great tutorials. ref 17:18 into video:if(set == null) The set parameter is not recognized. Is there another approach to check/create new set? Thank You and greetings from Norway

LEAVE A REPLY

Please enter your comment!
Please enter your name here