Thứ Năm, 5 tháng 12, 2013

How to get release key - android

Go to this path or where ever you have your keytool.exe file
C:\Program Files\Java\jre7\bin
Hold shift and right click -> then press Open command window here
terminal will pop up, paste this in:
keytool -list -v -keystore "C:\Users\"Your-User-Name(no quotes)"\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
You should see some lines with letters and numbers.
Find the line that begins by SHA1, like this one:
  • SHA1 : 84:BD:28:73:1B:6F:C2:84:2C:8D:03:11:56:19:E4:KD:38:C3:80:73
It's what we call a certificate fingerprint.
At this point, we have to take this SHA1 certificate fingerprint and transform it into a real key to put in our XML code.
And for that it's time to go to the Google APIs website.


Thứ Năm, 14 tháng 11, 2013

SDF Viewer Full

SDF Viewer cho phép bạn tạo, xem và chỉnh sửa cơ sở dữ liệu SQL Server Compact phiên bản 3.1 và 3.5. Đây là cách đơn giản để tạo, xem, chỉnh sửa, xuất dữ liệu trong Windows Mobile, Windows Phone hoặc cơ sở dữ liệu SQLCE Pocket PC.

Một số tính năng chính:

  • Hoạt động với cả hai cơ sở dữ liệu SQL Server CE phiên bản 3.1 và 3.5.
  • Mở cơ sở dữ liệu tập tin SDF trên máy tính của bạn
  • Tạo mới cơ sở dữ liệu SQL Server Compact Edition
  • Xem các cấu trúc cơ sở dữ liệu.
  • Tạo một bảng mới, đổi tên, sửa đổi bảng hiện tại ...
  • Thêm, xóa và sửa lại các cột dữ liệu
  • Tạo chỉ số mới
  • Xem, phân loại, thêm, sửa đổi và xóa dữ liệu từ bảng
  • Xem, thêm và thay đổi cột Image
  • Tạo truy vấn SQL và Scripts, cột và bảng tên để truy vấn
  • Mở, lưu, truy vấn file .sql
  • Thêm, thay đổi và hủy bỏ mật khẩu cơ sở dữ liệu
  • Nhỏ gọn và sửa chữa cơ sở dữ liệu
  • Nhập hình ảnh vào một cơ sở dữ liệu
  • Thiết lập một cơ sở dữ liệu tự động sao lưu các tập tin mỗi khi chúng được mở

Link download:

Thứ Ba, 5 tháng 11, 2013

Chủ Nhật, 13 tháng 10, 2013

Sửa lỗi "Check cable connection! pxe-m0f exiting intel pxe rom" - How to fix error "Check cable connection! pxe-m0f exiting intel pxe rom"

English translation down below

Hôm nay khi cài một laptop mới mua, thì mình gặp vấn đề, máy khi bật lên thì có thông báo: "Check cable connection! pxe-m0f exiting intel pxe rom"

Và sau đó mình tìm ra một cách khắc phục như sau:
- Vào BIOS Setup của máy. (F2 hoặc Fn + F2 ...)
- Tìm mục PXE Boot to LAN ( thường nằm trong thẻ Boot)
- Chuyển thành <Disabled>
- Thoát ra để vào lại.

Các bạn thử xem được không nha :p

------- ------- ------- ------- ------- ------- -------

Fix error "Check cable connection! pxe-m0f exiting intel pxe rom", I did this:
- Go to BIOS Setup (F2 or Fn + F2 ...)
- Click on PXE Boot to LAN ( in Boot tab)
- Set to <Disabled>
- Exit and restart.

Try this. Goodluck! :)

--Tuấn Vũ--

Thứ Tư, 2 tháng 10, 2013

Lấy vị trí thông qua GPS trong android - How to get location in android by gps

Để lấy được vị trí thông qua gps, chúng ta cần import:

import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;

và class cần implements LocationListener

Sau đó sử dụng hàm sau để lấy vị trí:

public LatLng getLocation() {
// Get the location manager
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String bestProvider = locationManager.getBestProvider(criteria, false);
Location location = locationManager.getLastKnownLocation(bestProvider);
Double lat, lon;
try {
lat = location.getLatitude();
lon = location.getLongitude();
return new LatLng(lat, lon);
} catch (NullPointerException e) {
e.printStackTrace();
return null;
}
}

--Tuấn Vũ--

Thứ Ba, 1 tháng 10, 2013

Cách update windows lậu

Bình thường, sau khi cài đặt windows thì mọi người thường tắt update đi để tránh bị lỗi máy, hôm nay mình ngồi sửa máy bị dính lỗi tự khởi động lại thì phát hiện ra một cách để update khá hay. Đó là mình cho máy trở về trạng thái ban đầu khi chưa crack, sau đó update, và cuối cùng crack trở lại

Các bạn vào theo đường dẫn sau:
Control Panel\System and Security\Administrative Tools
Nó hiện ra một list các file, bạn chọn Windows Memory Diagnostic
Sau đó chọn cái "Restart now and check for problem"
Cho nó khởi động lại và check lỗi.
Sau khi check lỗi song, nếu phát hiện ra lỗi thì là hay, còn bình thường thì chả có gì. Khi trở lại windows các bạn sẽ thấy máy chưa được active

Lúc này các bạn có thể update.
Sau khi update và install xong, thì chúng ta có thể crack lại :D

Mình làm thử và được, không biết máy khác thế nào, hên xui, hehe

Chúc một ngày vui vẻ :p

---Tuấn Vũ---

Thứ Ba, 24 tháng 9, 2013

How to fix Eclipse validation error “No grammar constraints (DTD or XML schema) detected for the document.”?

Eclipse is throwing an XML schema warning message in all xml file: “No grammar constraints (DTD or XML schema) detected for the document.”

answer:


I am not an expert but a learner. I accidentally found an easy and stupid way to solve the problem. What you just need to do is:
Press ctrl + shift + F (it's a shortcut to format the file in Eclipse)
If this does not solve the problem then press the TAB key at the starting of this particular line
?xml version="1.0" encoding="UTF-8"? and not anywhere else (I don't not why, but this works. If anyone here knows why I will be very happy to know)
Then press ctrl + shift + F and save.
The warning will be gone, at least for me, you may try for yourself...
--Madhavi--

Thứ Sáu, 20 tháng 9, 2013

Làm giảm dung lượng âm thanh, hình ảnh đầu vào

Các ứng dụng trên các dòng điện thoại phổ thông đời cũ của Nokia, hay chính dòng điện thoại cảm ứng Asha đều gặp phải vấn đề về dung lượng tài nguyên. Bản thân J2me chỉ cho phép file ứng dụng có kích cỡ tối đã là 2MB. Điều này gây không ít khó khăn cho người lập trình.

Qua quá trình làm việc và học hỏi mình có biết một số cách sau để làm giảm dung lượng ( sẽ bổ sung thêm dần dần):
Hình ảnh:

  • Lưu ý về kích cỡ màn hình sẽ hiển thị và cắt hình ảnh với kích cỡ phù hợp, to quá màn hình cũng không hiển thị hết được
  • Chọn định dạng hình ảnh, Các bạn có thể google để tìm hiểu về các định dạng và chọn cho mình một định dạng phù hợp. Tùy vào việc hình hiển thị của bạn cần chất lượng như thế nào, không gian bộ nhớ bạn muốn dành cho hình ảnh là bao nhiêu ...
  • Một mẹo khá thú vị mình học được từ ông em code asha, đó là khi muốn làm giảm dung lượng ảnh mà vẫn giữ nguyên được chất lượng ( một cách tương đối), thì hãy upload ảnh lên facebook và sau đó tải về. Khi đó ảnh của bạn sẽ nhẹ đi do đã được facebook chỉnh sửa lại. Mà công nghệ của Facebook chắc hẳn là rất ghê gớm, công ty hàng tỷ đô cơ mà. :p


Âm thanh:
  • Cắt âm thanh vừa khéo, nếu là âm thanh lặp liên tục thì chọn những đoạn lặp ngắn nhất. Cái ý này thực sự là khó vì mình đã thử nhưng làm mãi mới được và khi có sản phẩm cũng không ưng lắm. Vì âm thanh lặp mà không hay, người dùng rất dễ phát hiện các đoạn lặp và sẽ có cảm giác không thích.
  • Nếu âm thanh không cần quá cầu kỳ thì nên chọn những định dạng âm thanh như mid hay amr
Tuấn Vũ

Môn Công nghệ phần mềm - Sử dụng Visual paradigm for uml 8.0

Clip làm đã lâu, xin đăng lại, có nhiều điểm đúng và chưa đúng, mong các bạn chọn lọc khi xem :)


--Tuấn Vũ--

Thứ Tư, 11 tháng 9, 2013

Change values from one spinner to another in Android

I have 2 spinners in my activity as category and sub-category.
When i choose some value from category spinner
I want to display its related values/data in sub-category spinner.
How can i perform this?
public class SellActivity extends Activity { private Spinner spinner1, spinner2; private String selectedOption; List<String> addItemList = new ArrayList<String>(); String[] elCat = new String[] {"Mobile", "Television", "Computers","Home Appliances","Games","Others"}; String[] veCat = new String[] {"Cars", "Buses", "Motorcycles","Others"}; String[] reCat = new String[] {"Apartment", "Plot", "Office","Paying Guest","Others"}; String[] hCat = new String[] {"Books", "Furniture", "Musical Instrument","Watches","Others"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sell); spinner1 = (Spinner) findViewById(R.id.categorySellSpinner); spinner2 = (Spinner) findViewById(R.id.subCategorySpinner); selectedOption=String.valueOf(spinner1.getSelectedItem()); System.out.println(selectedOption); spinner1.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub if(selectedOption.equals("Electronics")) { Collections.addAll(addItemList, elCat); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(SellActivity.this,android.R.layout.simple_spinner_item, addItemList); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); dataAdapter.notifyDataSetChanged(); spinner2.setAdapter(dataAdapter); } else if(selectedOption.equals("Home - Lifestyle")) { Collections.addAll(addItemList, hCat); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(SellActivity.this,android.R.layout.simple_spinner_item, addItemList); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); dataAdapter.notifyDataSetChanged(); spinner2.setAdapter(dataAdapter); } else if(selectedOption.equals("Vehicles")) { Collections.addAll(addItemList, veCat); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(SellActivity.this,android.R.layout.simple_spinner_item, addItemList); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); dataAdapter.notifyDataSetChanged(); spinner2.setAdapter(dataAdapter); } else if(selectedOption.equals("Real Estate")) { Collections.addAll(addItemList, reCat); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(SellActivity.this,android.R.layout.simple_spinner_item, addItemList); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); dataAdapter.notifyDataSetChanged(); spinner2.setAdapter(dataAdapter); } } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }); }
}
Here is the whole code.
Data is not changing….plus old data adds onto it

Answer

Just do like this in every if condition :-
Collections.addAll(addItemList, elCat); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String(this,android.R.layout.simple_spinner_item, addItemList); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); dataAdapter.notifyDataSetChanged(); spinner2.setAdapter(dataAdapter);
Source:  http://stackoverflow.com/questions/17922979/change-spinner-data-android

Chủ Nhật, 8 tháng 9, 2013

Displaying any sized images on Android

ImageView imageView=new ImageView(this);
imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageView.setAdjustViewBounds(true);
FileInputStream fis=new FileInputStream(file);
BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize=2; //try to decrease decoded image
options.inPurgeable=true; //if necessary purge pixels into disk
options.inScaled=true; //scale down image to actual device density
Bitmap bm=BitmapFactory.decodeStream(is, null, options);
imageView.setImageBitmap(bm);
fis.close();