3

Code Demo vẽ biểu đồ Chart trong android dùng AchartEngine

Posted by chazo1994 on 06:41 in

ACHARTENGINE

Đây là code class demo vẽ đồ họa bằng achartengine
trước tiên vào đây để Download thư viện (down file jar)
trong android studio chuyển sang chế độ project copy file jar và paste vào thư mục libs
rồi chuyển về chế độ android
vào app -> build.grade (module) tìm để phần dependency{ .. } thêm dòng này vào
compile files('libs/achartengine120.jar')
 "achartengine120" sửa thành tên file jar của bạn

sau đó ấn build vậy là dùng đc thư viện achartengine rùi!!!

sau đây là class mình viết demo và có giải thích vài phần trong đó


 package com.example.thinh.designfilter.Util;  
 import android.graphics.Color;  
 import android.graphics.Paint;  
 import android.widget.LinearLayout;  
 import com.example.thinh.designfilter.DrawFilterActivity;  
 import org.achartengine.ChartFactory;  
 import org.achartengine.GraphicalView;  
 import org.achartengine.chart.PointStyle;  
 import org.achartengine.model.XYMultipleSeriesDataset;  
 import org.achartengine.model.XYSeries;  
 import org.achartengine.renderer.XYMultipleSeriesRenderer;  
 import org.achartengine.renderer.XYSeriesRenderer;  
 /**  
  * Created by thinh on 11/22/2015.  
  * class manage drawable Chart on Activity  
  */  
 public class DrawSignal {  
   private GraphicalView myChart;  
   private XYSeriesRenderer signalRenderer;  
   private XYSeries signalSeries;  
   private XYMultipleSeriesRenderer mySeriesRender;  
   private XYMultipleSeriesDataset mySeriesDataset;  
   private LinearLayout llChart;  // draw chart on listview of activity
   private DrawFilterActivity drawFilterActivity;  
   public DrawSignal(DrawFilterActivity drawFilterActivity, LinearLayout llChart ){  
     this.llChart = llChart;  
     this.drawFilterActivity = drawFilterActivity;  
   }  
   /*  
   * initialize all configuration to Chart  
   * */  
   public void initChart(){  
     signalRenderer = new XYSeriesRenderer();  
     mySeriesRender = new XYMultipleSeriesRenderer();  
     mySeriesDataset = new XYMultipleSeriesDataset();  
     //creat signal and filter that you want draw  
     signalSeries = new XYSeries("pulse");  
     // set XYSeriesRender to render data on screen   
     signalRenderer.setColor(Color.BLUE);  
     signalRenderer.setDisplayBoundingPoints(true);  
     signalRenderer.setPointStyle(PointStyle.CIRCLE);  
     signalRenderer.setPointStrokeWidth(1);  
     //set Render Control full chart (control: color, axist, background , line ...)  
     mySeriesRender.addSeriesRenderer(signalRenderer);  
     mySeriesRender.setPanEnabled(false, false);  
     mySeriesRender.setYAxisMax(0.5);  
     mySeriesRender.setYAxisMin(0);  
     mySeriesRender.setShowGrid(true);  
     mySeriesRender.setGridColor(Color.BLACK);  
     mySeriesRender.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent margin  
     mySeriesRender.setXLabels(10);  
     mySeriesRender.setYLabels(10);  
     mySeriesRender.setXLabelsColor(Color.BLUE);  
     mySeriesRender.setYLabelsColor(0, Color.BLUE);  
     mySeriesRender.setAxisTitleTextSize(5);  
     mySeriesRender.addXTextLabel(mySeriesRender.getXAxisMax(), "n");  
     mySeriesRender.addYTextLabel(mySeriesRender.getYAxisMax(), "h[n]");  
     mySeriesRender.setPointSize(4);  
     // add data signal and filter to dataset  
     mySeriesDataset.addSeries(signalSeries);  
     /*mySeriesDataset.addSeries(filterSeries);*/  
   }  
   /*  
   * Add data to XYSeries  
   * */  
   public void addData(double[] filters,int M){  
     for(int i = 0; i<M;i++){  
       signalSeries.add(i,filters[i]);  
     }  
   }  
      /*  
      * here is code to draw data in object signalRenderer on screen managed by mySeriesRender  
      */  
   public void DrawChart(double[] filters, int M){  
     initChart();  
     addData(filters,M);  
     GraphicalView gvChart = ChartFactory.getLineChartView(drawFilterActivity, mySeriesDataset, mySeriesRender);  
     //GraphicalView gvChart = ChartFactory.getBarChartView(drawFilterActivity, mySeriesDataset, mySeriesRender, BarChart.Type.DEFAULT);  
     llChart.addView(gvChart);  
   }  
 }  

0

MY COMPANY

Posted by chazo1994 on 09:27 in

TODAY: 18/11/2030
Hello everybody, I'm THINH. TONIGHT I'm staying here to address with you about my company


 The company's name is BKDAC (Bach khoa development application), which no body doesn't know. the company established in 2022. Headquaters locate at 01 on street TRẦN ĐẠI NGHĨA in HÀ NỘI city. the first period , the business is very difficult and we have little funds. currently, our company grown up and is becoming a big company.

 BKDAC are a company about Technology, our product is software,website and some device hardware... the first contract when my company established is make a android application. in this contract we engaged our software(app) have good UI (user interface) and this software must have enough feature,which customer required. We attached a warranty to our product. This warranty include the terms which we promise with customer about product, when your product broken or mistake. Currently we make several software such as Ghis application, BKDAC WEAHTER application, KG game, AILATRIEUPHU, IDK (I don't know =))) ) and website such as monreve.somee.com, chazo1994.blogspot.com... we also provide some device hardware like RAM, HDD, SD, CHIP, SNAPDRAGON, HEADPHONE, QUICK CHARGE, PIN, AMPLIFIER, KEY BOARD, MOUSE...

 FOR future of company,we have prepared a business plan and a strategic marketing for two year. In developing the plan, we analyze the market and we look at market VIET NAM is missing product smartphone made in VIET NAM. Through research consumer, A lot of customers VIET NAM want to buy a smartphone made in VIET NAM but this research quote customer require a high quality product. In addition, software online department are developing a website meeting online and a conference application, this product will provide some USE CASE (chức năng) like arrange room, manage attendee or hold a session online. About strategic marketing, we will focus to Internet and google play store. On internet we will advertise on our website and app on google play, we also pay for google to advertisement on other websites.

C'est tout, Thanks everybody, above I talk about my company and I want my company will become a part of your live for help all of you.

Above text, I talk about a Conference, where I want to become main character. hihi you can help me fix error grammar and writing style... please comment below, Thanks so much!



0

Ứng dụng Ghis

Posted by chazo1994 on 09:05 in

GHIS


PHẦN A: Tổng quan ý tưởng và tình trạng thực hiện

1) Ý tưởng
Tạo một ứng dụng với mục đích chính là giúp đỡ cho các em học sinh có hứng thú hơn với lịch sử
ứng dụng sẽ gồm 3 phần chính sau
  1- game lịch sử: xây dựng giống hình thức game ai là triệu phú với ngân hàng các câu hỏi lịch sử theo dạng trắc nghiệm (kiếm nguồn chắc từ google) có nguồn rồi kiểm duyệt.
  2- tutorial trợ giúp học lịch sử sẽ xây dựng serial các bài học ko theo chuẩn quy tắc nào mà chỉ là tổng hợp những sự kiện lịch sử lớn theo dòng thời gian dọc chiều dài lịch sử việt nam
nội dung mỗi bài gồm hai phần. phần chính là một clip có thể là hoạt hình minh họa về sự kiện đó
phần hai là tóm tắt nội dung bằng văn bản nêu nguyên nhân kết quả ý nghĩa và một đoạn comment mang ý kiến chủ quan theo quan điểm cá nhân của người soạn
 3- nhân vật lịch sử là một list các nhân vật lịch sử nổi tiếng của việt nam có cấu trúc như phần 2 nhưng về phần text có thay đổi và bỏ phần comment
 2) Tình trạng thực hiện
- thiết kế được layout,  thiết kế xong cơ sở dự liệu
- code được các khung giao diện chính với phần 1,2 là 2 fragment của tabs selection và 1 được focus trên main UI, phần 3 được đưa vào một list trong navigation bar drawer.

PHẦN A: Share app demo phần khung

Đang trong quá trình làm nên mới code được phần giao diện khung
đây là file apk để xem tham khảo
apkGhis

0

WEATHER APPLICATION ANDROID

Posted by chazo1994 on 12:06 in
Development application weather android

PHẦN MỘT: CHẠY THỬ ỨNG DỤNG ĐÃ ĐƯỢC XÂY DỰNG

DOWNLOAD  file sau về giải nén và copy file app-debug.apk vào smartphone or tablet rồi chạy ( install)

nếu máy của bạn có báo lối sau: Install blocked: For security, your .... is set to block installation of apps obtained from unknown source (nó chỉ muốn cho tải từ play store thôi =))))

=> cách giải quyết: vào Settings -> Security -> tim đến dòng Unknown sources và check vào đó nó hiện ra một cái ô thì ấn ok là được.
sau khi thiết lập như trên thì quay lại chạy file apk vừa down!
vậy là thành công và chạy thử thôi =))) thanks you!

PHẦN HAI: DÀNH CHO DEVELOPER

Download source code ứng dụng thời tiết trên android tại đây: tải source tại đây

sau khi giải nén thì mở bằng android studio vào file chọn open rồi tìm đến nơi chứa project và chọn cái project vừa giải nén (nó sẽ hiện biểu tượng màu xanh là cây của android studio).

nếu chỉ cần lấy source code thì vào phần sau: bkdacweather\app\src\main trong đó có thể lấy cả phần layout và mã nguồn java



0

GAME PSG JAVA ĐÁNH QUÁI NHIỀU MAP

Posted by chazo1994 on 09:35 in

SƠ ĐỒ KẾ HOẠCH LÀM GAME PSG


1

WRITE ABOUT MY DREAM HOUSE

Posted by chazo1994 on 11:59 in

MY DREAM HOUSE

In life 

    Every one has a dream beautiful and my dream, I whish have a house beautiful.
House iss the place to stay together with my family. A good house is te house which dweller feels comfortable.
   My Dream house is so simple luxurious and intelligent. In the house, I want to have four bedroom, one bedroom for my children later on And other bedroom for visitor. Every bedroom must enough smart system for example the system automatic light or the system automatic turn on air conditioning. There are four bathroom, one kitchen and one living room. In every bathroom there are eough device such as shower. In the living room there are complete facilities and the minimum , it must has one tv LG 71 inch, ome table, four chair etc... the kitchen is place where my wife like later on.
  Out side of the house. I will make a little garden on the right of the my house to watch the sunrise  and the sunset. on the left of my house I want a garage. Behind of my house I will make swimmng pool and small football yard. I will use that yard to play football with my children or my friend. Me and my wife will use swimming pool in the evening.
  I have spoken about my dream house. and I will endeavour complete my house.!!!


4

Xây dựng một game nhập vai SimpleRPG

Posted by chazo1994 on 12:23 in
ĐỀ TÀI
Người chơi có các ch s: Health Point, Attack, Defense, Speed… Quái vt có nhiu loi khác nhau và cũng có các ch s tương t người chơi. Có nhiu vùng đt khác nhau, được xác đnh trên mt mng hai chiu. Mỗi vùng đất có một số loại quái vật khác nhau với xác suất gặp khác nhau.
3
2
4
END
4
1
2
4
2
4
3
2
M0
2
0
1
Mi khi gp quái vt, người chơi có th b chy hoc có th li đánh quái vt. Khi quái vt b giết, người chơi sẽ nhận điểm kinh nghiệm để lên Level và tăng chỉ số. Người chơi có th di chuyển trên bản đồ, nếu đến M0, M1, M2… sẽ chuyển sang các map tương ứng. Trò chơi kết thúc khi người chơi di chuyển đến END.

Ghi chú: Sinh viên có th t phát trin hoặc thay đổi các yếu t trong game

PHÂN TÍCH YÊU CẦU ĐỀ TÀI:
-)người chơi sẽ nhập vai vào nhân vật. xây dựng nhân vật với các chỉ số Health Point, Attack, Defense, Speed... và quái vật cũng vậy
 người chơi di chuyển đến từng map để đánh quái vật mỗi map có một loại quái vật khác nhau . khi đánh thắng người chơi sẽ tăng level vậy sẽ cần quản lý nhân vật và quái vật với các chỉ số để tính toán thắng bại.
-) đánh quái cần quản lý chuyển động của người chơi
-) sau khi đánh thắng người chơi sẽ di chuyển đến map khác vậy cần quản lý tất cả các map.
-)mỗi map lại khác nhau vậy cần quản lý riêng từng map.
-) khi đến map cuối sẽ chiến thắng.

CÁC LỚP CẦN XÂY DỰNG:
Jfigure: quản lý nhân vật
Jmonster: quản lý quái vật
Jmove: quản lý chuyển động người chơi
Jmap: quản lý từng map
Jfullmap: quản lý bản đồ lớn

XÁC ĐỊNH THUỘC TÍNH VÀ PHƯƠN THỨC TỪNG LỚP:
class Jfigure: 
+) thuộc tính: 
         int Health Point, Attack, Defense, Speed, EXP, LEVEL,x,y; //x,y là tọa độ nhân vật
         Jmove move;
         Jmap  map;
+) phương thức:
       khởi tạo nhân vật;
       di chuyển;
       đánh quái;
       di chuyển giữa các map;
        hủy nhân vật;
class Jmonster:  
+) thuộc tính:
     
int Health Point, Attack, Defense, Speed;
      Jmove move;
      Jmap  map;
+) phương thức:
       khởi tạo quái vật;
       di chuyển;
       đánh nhân vật;
        hủy quái vật;
class Jmove
+) thuộc tính:
       int x,y;
       Jmap map;
+) phương thức:
       khởi tạo;
        tiến;
       lùi;
       đánh quái;
       hủy;
class Jmap
+) thuộc tính:
       int long,wide, loc; // loc vị trí quái
+) phương thức
       khởi tạo;
       hủy;
class Jfullmap
+thuộc tính:
        int long,wide;
        Jmap map, beginmap,endmap;
+)phươn thức:
         khởi tạo;
         hủy;

Copyright © 2009 Đừng Buông Tay Anh All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.